This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # event.rb | |
| def format_day | |
| self.day.strftime("%B %d, %Y (%A)") | |
| end | |
| def day_types | |
| OpenStruct.new(:day => self.day, :format => self.format_day) | |
| end | |
| # view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test_method_names_become_symbols | |
| assert_equal __, Symbol.all_symbols.include?("test_method_names_become_symbols".to_sym) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MyApplicationName::Application.configure do | |
| # Edit at your own peril - it's recommended to regenerate this file | |
| # in the future when you upgrade to a newer version of Cucumber. | |
| # IMPORTANT: Setting config.cache_classes to false is known to | |
| # break Cucumber's use_transactional_fixtures method. | |
| # For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165 | |
| config.cache_classes = true | |
| # Log error messages when you accidentally call methods on nil. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem "cucumber-rails", :git => "git://github.com/alg/cucumber-rails.git" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'bigdecimal' | |
| #Set values to determine output based on how much % of memory is free | |
| CRITICAL=5 | |
| WARNING=10 | |
| File.open "/proc/meminfo","r" do |line| | |
| @memtotal = BigDecimal.new($1) if line.gets =~ /MemTotal:\s+(\d+)\s+kB/ | |
| @memfree = BigDecimal.new($1) if line.gets =~ /MemFree:\s+(\d+)\s+kB/ | |
| end | |
| if @memtotal and @memfree | |
| @free_percentage = ((@memfree/@memtotal)*100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1>Register</h1> | |
| <% form_for(@user) do |f| %> | |
| <%= f.error_messages %> | |
| <% f.fields_for :person do |g| %> | |
| <p> | |
| <%= g.label :firstname %><br /> | |
| <%= g.text_field :firstname %> | |
| </p> | |
| <% end %> |
NewerOlder