ãµã¼ãã¼ Ruby ã® sinatra ã§ãé©å½ã« GET ããã¨ããããªç¶æ³ãä¿åãããµã¼ãã¼æ¸ãã https://gist.github.com/anekos/8255991 ä¸ç¬ã§ããã¾ããã Android ç«¯æ« Tasker ã¨ããã¢ããªã使ç¨ã HTTP Get ã®ã¢ã¯ã·ã§ã³ã使ã£ã¦ http://example.com/level/$devicename/$level ãå®æçã«å©ã (æ®æ®µãããã«ç¹ããªããããªç«¯æ«ã¯ãWIFI On > Wait (%WIFI = On) > WIFI Off ã¨ãããã¨ããã£ã½ãã ãã¼ã C# ã§é©å½ã«ããã°ã©ã æ¸ããã ããã¤ãã¿ã¹ã¯ã¹ã±ã¸ã¥ã¼ã©ã§ãå®æçã«å®è¡ãã¦ããã https://gist.github.com/anekos/8256104 å²ã¨è¦æ¦ãããã©ãå 容ã¯è¶ ç°¡åã BatteryLifePercent ã floa
Twitter authentication with OmniAuth¶ â OmniAuth provides several strategies (released as gems) that provides authentication for a lot of systems, such as Facebook, Google, GitHub, and many more. Each strategy is a Rack middleware, so it's very easy to integrate with Sinatra. This recipe will show you how to add user authentication to your Sinatra application using Twitter as your authentication p
A Sinatra-Sequel-RSpec Template Apr 25 rgraffwork rspec, sequel, sinatra 6 Comments Iâm just getting to the fun part of writing an app, the part where Iâm actually writing the app and not just trying to get my environment setup. A couple days ago, I wouldâve loved to have found a post that explains how to get Sinatra, Sequel, and RSpec working together plus have all the files organized so that I c
Ruby,Rubygems,MongoDBã¯ã¤ã³ã¹ãã¼ã«ããã¦ãããã®ã¨ãã MongoDBã®ã¤ã³ã¹ãã¼ã«ã«ã¤ãã¦ã¯CentOSã§ããã°åã«ã¡ãã£ã¨æ¸ãã éå»ã®è¨äºï¼CentOS5.5ã«MongoDBãã¤ã³ã¹ãã¼ã«ãã - chulip.org ã¤ã³ã¹ãã¼ã« Bundlerã使ç¨ãã¦å¿ è¦ãªGemãã¤ã³ã¹ãã¼ã«ããã ãªãMongoDBã®ORMã¨ãã¦Mongoidã使ç¨ãã $ gem install bundlerGemfile source :rubygems gem 'sinatra' gem 'mongoid' gem 'bson_ext' gem 'SystemTimer' #1.8.7ã ãå¿ è¦ã ã£ãã½ã group :test do gem 'rspec' gem 'rack-test' end$ bundle install bson_extã¨SystemTimer bson
Heads-up: Dashing still works great, but is no longer maintained. Read up about it over here. You can also use the fork of the project. Dashing is a Sinatra based framework that lets you build beautiful dashboards. Check out a demo over here. Here's another one, optimized for 1080p screens. Key features: Use premade widgets, or fully create your own with scss, html, and coffeescript. Widgets harne
Sleipnir for MacãSleipnir Mobile for iPhone/iPad éçºæ å½ã®ç¦äºã§ãã ä»åã¯ã¢ãã¤ã«ã¢ããªã®éçºæã«å½¹ã«ç«ã¤ãSinatra ãç´¹ä»ããã¦ããã ãã¾ãã ã¢ããªãéçºããã¨ããé£æºãã Web API ã®å®è£ ãã¾ã ãªãã¦å®è£ ãé²ããããªããAPI ã®å®è£ ã¨ä¸¦è¡ãã¦ã¢ããªãå®è£ ãã¦ã¯ã¿ããã©ãAPI ã¨é£æºãã¦ã¿ãã¨å ¨ç¶åããªãã£ãããããªçµé¨ããããã¨ã¯ããã¾ãããï¼Web API ãå®æãã¦ããªããã©ãã¢ããªã®ãªãªã¼ã¹ã¯é ããããã¨ãã§ããªãã¨ããã®ã¯ããããã·ãã¥ã¨ã¼ã·ã§ã³ã ã¨æãã¾ãããããªã¨ãã¯ãSinatra ã®å°å ¥ãæ¤è¨ãã¦ã¿ã¦ã¯ãããã§ããããã Sinatra ã¨ã¯ï¼ Sinatra ã¨ããã°ãã©ã³ã¯ã»ã·ããã©â¦ã§ã¯ãªã㦠Ruby 製 Web ã¢ããªã±ã¼ã·ã§ã³ãã¬ã¼ã ã¯ã¼ã¯ã§ããRuby 㧠Web ã¢ããªã±ã¼ã·ã§ã³ã¨ãã
ãããã«ãURLãå ¥ããã¨aã¿ã°ã®hrefå±æ§ã¨xy座æ¨ã¨å¹ ã¨é«ããåããç°¡åãªã¢ããªãä½ã£ã¦ã¿ããherokuã§webkitãåãã¦ã¦ãµã¼ãã¼å´ã§ãã£ãããã¼ã¸ãã¬ã³ããªã³ã°ãã¦ãããã座æ¨ã¨ãããããã http://phantom-getlinks.herokuapp.com/ ã½ã¼ã¹ã³ã¼ã https://github.com/shokai/sinatra-heroku-phantomjs readmeã«æ¸ãã¦ããéãããã°ãã¼ã«ã«ã§ãHerokuã§ãããåãããã®ã§cloneãã¦ã¿ãã¨ããã PhantomJSã§ãã¼ã¸ãã¬ã³ããªã³ã°ãã¦ããaã¿ã°ã®åº§æ¨ã¨ãèªã PhantomJSã¯ããã»ã¹å ã«webãã©ã¦ã¶(webkit)ãèµ·åãã¦ãããããã®ä¸ã®JavaScriptã«ã¢ã¯ã»ã¹ã§ãã â æ©æ¬åä¼ Â» PhantomJSã§webãã¼ã¸å ã®JavaScriptãèªã Phantom
以åæ¸ãããã®ã®ç¶ãã§ãã rspecã¨åæ§ã»ã¨ãã©å¤ãã¯ããã¾ãããã¨è¨ã£ããéãããã ãµã³ãã«ã³ã¼ã require './hello_world' require 'capybara' require 'capybara/dsl' require 'test/unit' class HelloWorldTest < Test::Unit::TestCase include Capybara::DSL # Capybara.default_driver = :selenium def setup Capybara.app = Sinatra::Application.new end def test_it_works visit '/' assert page.has_content?('Hello World') end end ã³ã¼ãã®ç解 capybaraã使ãå ´å㯠capy
以åæ¸ãããã®ã®ç¶ãã§ãã é¡åã®éãsinatraã§rspecã使ãåºæ¬çãªãã¨ããã«ãªãã¾ãã sinatraã ãã®è¨å®ãèããã¨test/unitã¨åãã§ããä¹±æ´ã«è¨ãã¨assertãshouldã«ãªãã ãã ã¨æã£ã¦ããã¨æãã¾ãã ãµã³ãã«ã³ã¼ã ååã®ãµã³ãã«ã³ã¼ããrspecã§æ¸ãã require './hello_world' require 'rspec' require 'rack/test' set :environment, :test describe 'The HelloWorld App' do include Rack::Test::Methods def app Sinatra::Application end it "says hello" do get '/' last_response.should be_ok last_response.body.
Testing Sinatra with Rack::Test All examples in the following sections assume that Test::Unit is being used in an attempt to be as general as possible. See the Test Framework Examples for information on using the test helpers in other testing environments. To use the Rack::Test library used when you require rack/test, youâll need to install the rack-test gem:
ãsinatraããã¼ãã£ã¦ä»ããæããsinatraã§ä½ãä½ã£ã¦ã¿ããããã¼ã¨æããå½ç¶ãã¹ãã®ãã¨ãæ°ã«ãªãã¾ããã ããããããã¹ãåºæ¥ãã®ï¼å®ã¯railsã¨æ¯ã¹ã¦å¤§å¤ãããªãã®ï¼ï¼ï¼ãã£ã¦æãã®ã¢ããªä¸å®ã§ããã(1é±éåã¾ã§sinatraã®ãã¨ã¨è¨ãã°ååãããããªãã£ãã®ã§ãã)ãã¹ãã«ã¤ãã¦ã¯ã¡ããã¨å ¬å¼ãã¼ã¸ã§è§£èª¬ããã¦ãã¾ããrspecã使ãã¾ããcapybaraã使ãã¾ããä»ã®ãã¹ããã¬ã¼ã ã¯ã¼ã¯ã使ããããã§ãã åèãã¼ã¸ã¯ Testing Sinatra with Rack::Test ã§ããããã®å 容ãç解ãã¦ããã¾ãã ãµã³ãã«ã³ã¼ã ãã¹ã対象ã®ã³ã¼ãããã¤ãã®hello worldã require 'sinatra' get '/' do "Hello World #{params[:name]}".strip end ãã¹ãã³ã¼ã require '.
å æ¥æ¸ããã麻éã¹ã¯ãªãããSinatraã«ä¹ã£ãã¦ã¿ã¾ããã ã»rubyã§éº»éã®å¾ ã¡ãåºå - ããããããããæ¥è¨ ã»éº»éã¹ã¯ãªããã®ãã¹ãã³ã¼ã - ããããããããæ¥è¨ amachangä½ã®âãã¿ã¦ æ¸ ä¸è²ã¡ã¼ã«ã¼ rubyã§ãsinatra使ãã°ãµã¯ãã¨ã§ããï¼ãããï¼ããã ã¨æãç«ã¡ãã£ã¬ã³ã¸ãã¦ã¿ã¾ããã ã¤ãã§ã«ãsinatraã§RSpecåããã®ã¨ã ã¡ããã¨ä½¿ã£ããã¨ã®ç¡ãhaml/saasããããæ©ã«ä½¿ã£ã¦ã¿ã¾ããã ã½ã¼ã¹ rochefort/majang_sina - GitHub herokuãããã¤å 麻éè´çãã§ãã«ã¼ ãããªãããã ææ³ ãã¾ããã¤ã¾ãã¬ãã®ã...ãæãããã¾ãããå人çã«ã¯ãããã試ãã¦è¯ãã£ãã§ãã ã»ã¨ãã©ãã¶ã¤ã³å ¥ãã¦ç¡ãã®ã§ãhaml / saasã®ééå³ã¯å³ããã¦ã¾ããã saasã¯ããç¨åº¦ã«ã¼ã«æ±ºããã°ãcssã¯çµæ§ãã¬
Sinatra ã¯Rubyã®è»½éã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã§ãã ã³ã³ã½ã¼ã«ã«åºåããã®ã§ã¯ãªãããã©ã¦ã¶ã«è¡¨ç¤ºãããã¨ã§ãã¡ãã£ã¨ããè¦æ ãã®ããã¢ããªã±ã¼ã·ã§ã³ãæ¸ãã®ã«åãã¦ãã¾ãã Top ã¤ã³ã¹ãã¼ã« ç°¡åãªä¾ (1) ç°¡åãªä¾ (2) HTMLã®ãã¼ã¸ãä½ã ããè¤éãªã¢ããªã®å ´å ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ ã»ãã·ã§ã³ ãã©ã¼ã ã¨postã¡ã½ãã ãã£ã«ã¿ ã¯ã©ã¹ã®æ§æ è¨å® ã³ãã³ã ãã¹ã Sinatra::Contrib Extensionã®ä½¿ç¨ Sinatra::Reloader Apacheã¨Sinatra (Passenger) Apacheã¨Sinatra (FastCGI) ã¤ã³ã¹ãã¼ã« ã¤ã³ã¹ãã¼ã«æ¹æ³ã¯ããããã®ã©ããã«è©³ããæ¸ãã¦ããã¾ãããgemã使ããããªæãã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã $ sudo gem install sinatra ã¡ããã¨ã¤ã³ã¹ãã¼ã«
Top ã¤ã³ã¹ãã¼ã« ç°¡åãªä¾ (1) ç°¡åãªä¾ (2) HTMLã®ãã¼ã¸ãä½ã ããè¤éãªã¢ããªã®å ´å ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ ã»ãã·ã§ã³ ãã©ã¼ã ã¨postã¡ã½ãã ãã£ã«ã¿ ã¯ã©ã¹ã®æ§æ è¨å® ã³ãã³ã ãã¹ã Sinatra::Contrib Extensionã®ä½¿ç¨ Sinatra::Reloader Apacheã¨Sinatra (Passenger) Apacheã¨Sinatra (FastCGI) ã¯ã©ã¹ã®æ§æ Application ã¯ã©ã·ãã¯ã¹ã¿ã¤ã«ã¢ããªã±ã¼ã·ã§ã³ã®å®è¡ãåãæã¤ã¯ã©ã¹ã Base ãã¹ã¦ã®Sinatraã¢ããªã±ã¼ã·ã§ã³ã¨ããã«ã¦ã§ã¢ã®åºç¤ã¨ãªãã¯ã©ã¹ã Templates::ContentTyped content_typeå±æ§ã®ã¿ãæã¤ã¢ã¸ã¥ã¼ã«ã Delegator ãã®ã¢ã¸ã¥ã¼ã«ãå«ãããã¨ã«ãããSinatra::Applicationã®ãã¹
This is a Sinatra extension that provides Linked Data content negotiation for Sinatra applications. http://github.com/datagraph/sinatra-linkeddata Features Implements HTTP content negotiation for RDF content types using the Rack::LinkedData middleware. Supports all RDF.rb-compatible serialization formats. Supports both classic and modular Sinatra applications. Examples Adding Linked Data content n
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}