rad_core 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/Rakefile +2 -2
  2. data/bin/rad +20 -25
  3. data/lib/components/config.rb +1 -1
  4. data/lib/components/configurators.rb +2 -2
  5. data/lib/components/controller.rb +2 -2
  6. data/lib/components/conveyors.rb +2 -2
  7. data/lib/components/environment.rb +1 -1
  8. data/lib/components/environment.yml +28 -28
  9. data/lib/components/flash.rb +1 -1
  10. data/lib/components/html.rb +1 -1
  11. data/lib/components/http.rb +1 -1
  12. data/lib/components/http.yml +1 -1
  13. data/lib/components/logger.rb +2 -2
  14. data/lib/components/mailer.rb +2 -2
  15. data/lib/components/remote.rb +1 -1
  16. data/lib/components/router.rb +3 -3
  17. data/lib/components/template.rb +2 -2
  18. data/lib/components/web.rb +3 -3
  19. data/lib/rad.rb +1 -1
  20. data/lib/rad/_support/active_support.rb +7 -7
  21. data/lib/rad/_support/active_support/locales/ru/actionview.yml +8 -8
  22. data/lib/rad/_support/active_support/locales/ru/activesupport.yml +4 -4
  23. data/lib/rad/_support/active_support/locales/ru/datetime.yml +5 -5
  24. data/lib/rad/_support/active_support/time.rb +2 -2
  25. data/lib/rad/_support/addressable.rb +6 -6
  26. data/lib/rad/_support/class_loader.rb +1 -1
  27. data/lib/rad/_support/extensions.rb +5 -5
  28. data/lib/rad/_support/filters.rb +13 -13
  29. data/lib/rad/_support/hacks_and_fixes.rb +5 -5
  30. data/lib/rad/_support/mime.rb +4 -4
  31. data/lib/rad/_support/module.rb +11 -11
  32. data/lib/rad/_support/require.rb +5 -5
  33. data/lib/rad/_support/rson.rb +4 -4
  34. data/lib/rad/_support/string.rb +9 -9
  35. data/lib/rad/cli/helper.rb +5 -5
  36. data/lib/rad/configurators/_require.rb +2 -2
  37. data/lib/rad/configurators/abstract.rb +5 -5
  38. data/lib/rad/configurators/web.rb +8 -8
  39. data/lib/rad/controller/_abstract.rb +15 -14
  40. data/lib/rad/controller/_abstract/miscellaneous.rb +5 -5
  41. data/lib/rad/controller/_abstract/render.rb +40 -40
  42. data/lib/rad/controller/_abstract/responder.rb +1 -1
  43. data/lib/rad/controller/_context.rb +1 -1
  44. data/lib/rad/controller/_http.rb +11 -11
  45. data/lib/rad/controller/_require.rb +6 -6
  46. data/lib/rad/controller/processors/controller_caller.rb +3 -3
  47. data/lib/rad/controller/processors/controller_error_handling.rb +14 -14
  48. data/lib/rad/controller/processors/controller_logger.rb +1 -1
  49. data/lib/rad/conveyors/_conveyor.rb +9 -9
  50. data/lib/rad/conveyors/_conveyors.rb +4 -4
  51. data/lib/rad/conveyors/_params.rb +5 -5
  52. data/lib/rad/conveyors/_processor.rb +2 -2
  53. data/lib/rad/conveyors/_workspace.rb +5 -5
  54. data/lib/rad/conveyors/processors/conveyor_logger.rb +3 -3
  55. data/lib/rad/environment/_config.rb +4 -4
  56. data/lib/rad/environment/_environment.rb +10 -10
  57. data/lib/rad/environment/_files_helper.rb +5 -5
  58. data/lib/rad/environment/_logger.rb +9 -9
  59. data/lib/rad/environment/_require.rb +4 -4
  60. data/lib/rad/gems.rb +14 -14
  61. data/lib/rad/html/_flash.rb +5 -5
  62. data/lib/rad/html/_helpers/basic_html_helper.rb +12 -12
  63. data/lib/rad/html/_helpers/form_helper.rb +19 -19
  64. data/lib/rad/html/_helpers/javascript_helper.rb +6 -6
  65. data/lib/rad/html/_helpers/model_helper.rb +17 -17
  66. data/lib/rad/html/_require.rb +1 -1
  67. data/lib/rad/html/processors/prepare_flash.rb +3 -3
  68. data/lib/rad/html/processors/scoped_params.rb +4 -4
  69. data/lib/rad/http/_http.rb +4 -4
  70. data/lib/rad/http/_http_adapter.rb +5 -5
  71. data/lib/rad/http/_request.rb +11 -11
  72. data/lib/rad/http/_require.rb +8 -8
  73. data/lib/rad/http/_response.rb +5 -5
  74. data/lib/rad/http/_support/rack/fixes.rb +3 -3
  75. data/lib/rad/http/_support/rack/rack_adapter.rb +5 -5
  76. data/lib/rad/http/processors/evaluate_format.rb +4 -4
  77. data/lib/rad/http/processors/http_logger.rb +3 -3
  78. data/lib/rad/http/processors/http_writer.rb +7 -7
  79. data/lib/rad/http/processors/prepare_params.rb +5 -5
  80. data/lib/rad/mailer/_letter.rb +1 -1
  81. data/lib/rad/mailer/_mailer.rb +1 -1
  82. data/lib/rad/mailer/_mailer_controller.rb +6 -6
  83. data/lib/rad/mailer/_require.rb +1 -1
  84. data/lib/rad/mailer/processors/letter_builder.rb +6 -6
  85. data/lib/rad/profiles/mailer.rb +2 -2
  86. data/lib/rad/profiles/web.rb +13 -13
  87. data/lib/rad/remote/processors/remote_caller.rb +10 -10
  88. data/lib/rad/remote/processors/remote_logger.rb +1 -1
  89. data/lib/rad/router/_abstract_router.rb +9 -9
  90. data/lib/rad/router/_alias_router.rb +34 -34
  91. data/lib/rad/router/_basic_router.rb +12 -12
  92. data/lib/rad/router/_configurator.rb +6 -6
  93. data/lib/rad/router/_core_routing_helper.rb +4 -4
  94. data/lib/rad/router/_object_router.rb +45 -45
  95. data/lib/rad/router/_require.rb +8 -8
  96. data/lib/rad/router/_restful_router.rb +25 -25
  97. data/lib/rad/router/_router.rb +78 -78
  98. data/lib/rad/router/_simple_router.rb +5 -5
  99. data/lib/rad/router/processors/router.rb +6 -6
  100. data/lib/rad/spec/controller.rb +9 -9
  101. data/lib/rad/spec/environment.rb +7 -7
  102. data/lib/rad/spec/http.rb +2 -2
  103. data/lib/rad/spec/http_controller.rb +22 -22
  104. data/lib/rad/spec/mailer.rb +4 -4
  105. data/lib/rad/spec/remote.rb +1 -1
  106. data/lib/rad/spec/router.rb +4 -4
  107. data/lib/rad/spec/template.rb +2 -2
  108. data/lib/rad/tasks.rb +2 -2
  109. data/lib/rad/template/_context.rb +15 -15
  110. data/lib/rad/template/_relative_path_resolver.rb +1 -1
  111. data/lib/rad/template/_support/tilt.rb +17 -17
  112. data/lib/rad/template/_support/tilt_fixes.rb +3 -3
  113. data/lib/rad/template/_template.rb +47 -47
  114. data/lib/rad/web/_ajax_helper.rb +4 -4
  115. data/lib/rad/web/_controller_miscellaneous_helper.rb +5 -5
  116. data/lib/rad/web/_ensure_no_www.rb +5 -5
  117. data/lib/rad/web/_protect_from_forgery.rb +18 -18
  118. data/lib/rad/web/_require.rb +7 -7
  119. data/lib/rad/web/_router/abstract_routing_helper.rb +4 -4
  120. data/lib/rad/web/_router/controller_routing_helper.rb +15 -15
  121. data/lib/rad/web/_router/view_routing_helper.rb +12 -12
  122. data/readme.md +5 -5
  123. data/spec/controller/abstract_spec.rb +29 -29
  124. data/spec/controller/context_spec.rb +32 -32
  125. data/spec/controller/error_handling_spec.rb +31 -31
  126. data/spec/controller/helper_spec.rb +13 -13
  127. data/spec/controller/http_spec.rb +32 -32
  128. data/spec/controller/render_spec.rb +59 -59
  129. data/spec/conveyors/conveyors_spec.rb +32 -32
  130. data/spec/environment/config_spec.rb +6 -6
  131. data/spec/environment/environment_spec.rb +7 -7
  132. data/spec/environment/minimal_app_spec.rb +4 -4
  133. data/spec/environment/standard_app_spec.rb +10 -10
  134. data/spec/html/basic_html_helper_spec.rb +6 -6
  135. data/spec/html/form_helper_spec.rb +5 -5
  136. data/spec/html/javascript_helper_spec.rb +4 -4
  137. data/spec/html/model_helper_spec.rb +12 -12
  138. data/spec/html/scoped_params_spec.rb +2 -2
  139. data/spec/html/spec_helper.rb +3 -3
  140. data/spec/http/http_spec.rb +9 -9
  141. data/spec/http/miscellaneous_spec.rb +2 -2
  142. data/spec/mailer/mail_controller_spec.rb +23 -23
  143. data/spec/remote/remote_spec.rb +26 -26
  144. data/spec/router/alias_router_spec.rb +22 -22
  145. data/spec/router/basic_router_spec.rb +8 -8
  146. data/spec/router/configurator_spec.rb +4 -4
  147. data/spec/router/integration_spec.rb +17 -17
  148. data/spec/router/object_router_spec.rb +47 -47
  149. data/spec/router/persistent_params_spec.rb +18 -18
  150. data/spec/router/restful_router_spec.rb +39 -39
  151. data/spec/router/router_spec.rb +37 -37
  152. data/spec/router/routing_helper_spec.rb +18 -18
  153. data/spec/support/filters_spec.rb +11 -13
  154. data/spec/template/template_spec.rb +43 -45
  155. data/spec/template/template_spec/views/layout/content_for/content.erb +3 -1
  156. data/spec/template/template_spec/views/layout/content_for/layout.erb +1 -1
  157. data/spec/template/tilt_spec.rb +24 -24
  158. data/spec/web/basic_spec.rb +25 -25
  159. data/spec/web/controller_routing_helper_spec.rb +26 -26
  160. data/spec/web/flash_spec.rb +31 -31
  161. data/spec/web/protect_from_forgery_spec.rb +44 -44
  162. data/spec/web/spec_helper_spec.rb +16 -16
  163. data/spec/web/view_routing_helper_spec.rb +31 -31
  164. metadata +46 -49
  165. data/lib/rad/_support/callbacks.rb +0 -166
  166. data/lib/rad/_support/ruby_ext_with_active_support.rb +0 -4
  167. data/spec/support/callbacks_spec.rb +0 -157
data/Rakefile CHANGED
@@ -2,10 +2,10 @@ require 'rake_ext'
2
2
 
3
3
  project(
4
4
  name: 'rad',
5
- official_name: 'rad_core',
5
+ official_name: 'rad_core',
6
6
  gem: true,
7
7
  summary: 'Simple and highly customizable Web Framework encouraging to build an app as a set of low-coupled components instead of monolith',
8
-
8
+
9
9
  bin: 'bin',
10
10
  executables: ['rad'],
11
11
  dirs: %w(bin views),
data/bin/rad CHANGED
@@ -1,34 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
- # sadly it's impossible to pass '-Ku' argument to ruby via shebang, use RUBYOPT to set it, something like:
3
- # $ export RUBYOPT="-Ku -rrubygems"
4
2
 
5
3
  require 'rad'
6
4
  require 'rad/cli/helper'
7
5
 
8
- # version
9
- if ARGV.first =~ /-v|version|-version/
10
- puts "Rad #{Rad::VERSION}"
11
- exit
12
- end
6
+ require 'optparse'
7
+ OptionParser.new do |opts|
8
+ opts.banner = <<-TEXT
9
+ Rad Application Framework
13
10
 
14
- # mode and environment
15
- mode = (%w(server console).include? ARGV.first) ? ARGV.shift : 'server'
16
- environment = (%w(production development test).include? ARGV.first) ? ARGV.shift : :development
17
- rad.mode = environment
11
+ Usage:
12
+ $ rad
13
+ $ rad production
14
+ $ rad console production
18
15
 
19
- warn 'update options'
20
- # config options
21
- ARGV.each do |expression|
22
- name, value = expression.split('=')
23
- name.sub!(/^-+/, '')
24
- if name =~ /\./
25
- component_name, key = name.split('.').collect{|s| s.to_sym}
26
- rad.config[component_name] ||= {}
27
- rad.config[component_name][key] = value
28
- else
29
- rad.config[name.to_sym] = value
16
+ TEXT
17
+
18
+ opts.on('-v', "--version", "Version.") do |v|
19
+ puts "Rad Application Framework #{Rad::VERSION}"
20
+ exit
30
21
  end
31
- end
32
-
22
+ end.parse!
23
+
24
+ # runner and mode
25
+ runner = (%w(server console).include? ARGV.first) ? ARGV.shift : 'server'
26
+ rad.mode = (%w(production development test).include? ARGV.first) ? ARGV.shift : :development
27
+
33
28
  # running
34
- Rad::Cli::Helper.send "run_#{mode}"
29
+ Rad::Cli::Helper.send "run_#{runner}"
@@ -1,6 +1,6 @@
1
1
  rad.register :config do
2
2
  require 'rad/environment/_require'
3
-
3
+
4
4
  config = Rad::Config.new
5
5
  config
6
6
  end
@@ -1,5 +1,5 @@
1
- rad.register :configurators, depends_on: :environment do
1
+ rad.register :configurators, depends_on: :environment do
2
2
  require 'rad/configurators/_require'
3
-
3
+
4
4
  Rad::Conveyors.new
5
5
  end
@@ -1,5 +1,5 @@
1
1
  rad.register :controller, depends_on: [:conveyors, :template, :http] do
2
- require 'rad/controller/_require'
3
-
2
+ require 'rad/controller/_require'
3
+
4
4
  Rad::Controller.new
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # Conveyor is the heart of Rad, it allows for Processors to process request and build responce.
2
2
 
3
- rad.register :conveyors, depends_on: :environment do
3
+ rad.register :conveyors, depends_on: :environment do
4
4
  require 'rad/conveyors/_require'
5
-
5
+
6
6
  Rad::Conveyors.new
7
7
  end
@@ -1,5 +1,5 @@
1
1
  rad.register :environment, depends_on: [:config, :logger] do
2
- require 'rad/environment/_require'
2
+ require 'rad/environment/_require'
3
3
  rad.logger.info "RAD #{Rad::VERSION} starting in :#{rad.mode} mode (at #{Time.now.to_s})" unless rad.test?
4
4
  Rad::Environment.new
5
5
  end
@@ -2,31 +2,31 @@ available_languages:
2
2
  - :en
3
3
  language: :en
4
4
 
5
- # backtrace_filters:
6
- # - /timeout.rb
7
- # - rubygems/custom_require
8
- # - /bin/spec
9
- # - /monitor
10
- # - /synchronize
11
- # - internal:lib/
12
- #
13
- # - /gems/haml
14
- # - /gems/tilt
15
- # - /gems/rack
16
- # - /gems/rspec
17
- # - /gems/thin
18
- # - /gems/eventmachine
19
- # - /gems/mongoid
20
- #
21
- # - lib/fake_gem
22
- # - /class_loader
23
- # - /micon
24
- #
25
- # - /kit/
26
- # - /rad/
27
- # - /face/
28
- #
29
- # # - /rad/template
30
- # # - /rad/_support
31
- # # - /face/view_builder
32
- # # - /face/view_helper
5
+ backtrace_filters:
6
+ - /timeout.rb
7
+ - rubygems/custom_require
8
+ - /bin/spec
9
+ - /monitor
10
+ - /synchronize
11
+ - internal:lib/
12
+
13
+ - /gems/haml
14
+ - /gems/tilt
15
+ - /gems/rack
16
+ - /gems/rspec
17
+ - /gems/thin
18
+ - /gems/eventmachine
19
+
20
+ - lib/fake_gem
21
+ - /class_loader
22
+ - /micon
23
+
24
+ # - /kit/
25
+ # - /rad/
26
+ # - /face/
27
+
28
+ - /rad/template
29
+ - /rad/_support
30
+ - /ruby_ext/more/callbacks
31
+ - /face/view_builder
32
+ - /face/view_helper
@@ -1,5 +1,5 @@
1
1
  rad.register :flash, scope: :cycle, depends_on: [:html] do
2
2
  workspace = rad.workspace
3
- workspace.params.must_be.defined
3
+ workspace.params.must_be.defined
4
4
  Rad::Html::Flash.new workspace.params.format
5
5
  end
@@ -1,4 +1,4 @@
1
1
  rad.register :html, depends_on: [:http, :template] do
2
- require 'rad/html/_require'
2
+ require 'rad/html/_require'
3
3
  Rad::Html.new
4
4
  end
@@ -1,6 +1,6 @@
1
1
  # Http provides support for Http protocol (via Rack)
2
2
 
3
3
  rad.register :http, depends_on: :conveyors do
4
- require 'rad/http/_require'
4
+ require 'rad/http/_require'
5
5
  http = Rad::Http.new
6
6
  end
@@ -10,7 +10,7 @@ browser_generated_types:
10
10
  - text/plain
11
11
  - text/javascript
12
12
  - application/x-www-form-urlencoded
13
- - multipart/form-data
13
+ - multipart/form-data
14
14
  browser_generated_formats:
15
15
  - html
16
16
  - js
@@ -1,5 +1,5 @@
1
- rad.register :logger do
1
+ rad.register :logger do
2
2
  require 'rad/environment/_require'
3
-
3
+
4
4
  Rad::Logger.new
5
5
  end
@@ -1,9 +1,9 @@
1
1
  rad.register :mailer, depends_on: [:controller, :template] do
2
2
  require 'rad/mailer/_require'
3
-
3
+
4
4
  rad.development do
5
5
  Mail.defaults{delivery_method :test}
6
6
  end
7
-
7
+
8
8
  Rad::Mailer.new
9
9
  end
@@ -1,4 +1,4 @@
1
1
  rad.register :remote, depends_on: :conveyors do
2
- require 'rad/remote/_require'
2
+ require 'rad/remote/_require'
3
3
  Rad::Remote.new
4
4
  end
@@ -1,11 +1,11 @@
1
1
  rad.register :router, depends_on: [:conveyors, :http] do
2
2
  require 'rad/router/_require'
3
-
3
+
4
4
  Rad::Router.new(
5
- :class,
5
+ :class,
6
6
  [
7
7
  [:alias_router, Rad::Router::AliasRouter.new],
8
- [:basic_router, Rad::Router::BasicRouter.new],
8
+ [:basic_router, Rad::Router::BasicRouter.new],
9
9
  [:restful_router, Rad::Router::RestfulRouter.new],
10
10
  [:simple_router, Rad::Router::SimpleRouter.new]
11
11
  ]
@@ -1,8 +1,8 @@
1
1
  rad.register :template do
2
2
  require 'rad/template/_require'
3
-
3
+
4
4
  template = Rad::Template.new
5
5
  rad_dir = "#{__FILE__}/../../../..".dirname
6
- template.paths << "#{rad_dir}/views"
6
+ template.paths << "#{rad_dir}/views"
7
7
  template
8
8
  end
@@ -1,8 +1,8 @@
1
- rad.register :web, depends_on: [:html, :router, :controller, :http, :configurators] do
1
+ rad.register :web, depends_on: [:html, :router, :controller, :http, :configurators] do
2
2
  require 'rad/web/_require'
3
-
3
+
4
4
  load 'rad/profiles/web.rb'
5
5
  load 'rad/profiles/mailer.rb'
6
-
6
+
7
7
  true
8
8
  end
data/lib/rad.rb CHANGED
@@ -4,5 +4,5 @@ end
4
4
 
5
5
  require 'rad/_support/require'
6
6
 
7
- # Environment is the basic component of Rad
7
+ # Environment is the basic component of Rad
8
8
  # it prepares and assembles your app ($LOAD_PATH, plugins and config files)
@@ -1,6 +1,6 @@
1
- #
1
+ #
2
2
  # Some features of ActiveSupport conflicting with Rad, skipping it
3
- #
3
+ #
4
4
  %w(
5
5
  active_support/dependencies.rb
6
6
  ).each do |relative_path|
@@ -13,11 +13,11 @@ end
13
13
  require 'active_support/all'
14
14
 
15
15
  # gem 'activesupport' #, '= 2.3.5'
16
- #
16
+ #
17
17
  # # autoload :BacktraceCleaner, 'active_support/backtrace_cleaner'
18
18
  # autoload :Base64, 'active_support/base64'
19
19
  # # autoload :BasicObject, 'active_support/basic_object' we use our own implementation
20
- #
20
+ #
21
21
  # # autoload :BufferedLogger, 'active_support/buffered_logger'
22
22
  # # autoload :Cache, 'active_support/cache'
23
23
  # # autoload :Callbacks, 'active_support/callbacks'
@@ -38,16 +38,16 @@ require 'active_support/all'
38
38
  # autoload :TimeWithZone, 'active_support/time_with_zone'
39
39
  # autoload :TimeZone, 'active_support/values/time_zone'
40
40
  # # autoload :XmlMini, 'active_support/xml_mini'
41
- #
41
+ #
42
42
  # # require 'active_support/vendor'
43
43
  # require 'active_support/core_ext'
44
44
  # # require 'active_support/dependencies'
45
45
  # # require 'active_support/json'
46
46
 
47
47
 
48
- #
48
+ #
49
49
  # Hacks
50
- #
50
+ #
51
51
  %w(
52
52
  miscellaneous
53
53
  time
@@ -12,7 +12,7 @@ ru:
12
12
  delimiter: " "
13
13
  # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
14
14
  precision: 3
15
-
15
+
16
16
  # Used in number_to_currency()
17
17
  currency:
18
18
  format:
@@ -26,14 +26,14 @@ ru:
26
26
  separator: "."
27
27
  delimiter: " "
28
28
  precision: 2
29
-
29
+
30
30
  # Used in number_to_percentage()
31
31
  percentage:
32
32
  format:
33
33
  # These three are to override number.format and are optional
34
- # separator:
34
+ # separator:
35
35
  delimiter: ""
36
-
36
+
37
37
  # Used in number_to_precision()
38
38
  precision:
39
39
  format:
@@ -41,18 +41,18 @@ ru:
41
41
  # separator:
42
42
  delimiter: ""
43
43
  # precision:
44
-
44
+
45
45
  # Used in number_to_human_size()
46
46
  human:
47
47
  format:
48
48
  # These three are to override number.format and are optional
49
- # separator:
49
+ # separator:
50
50
  delimiter: ""
51
51
  precision: 1
52
-
52
+
53
53
  # Rails 2.2
54
54
  # storage_units: [байт, КБ, МБ, ГБ, ТБ]
55
-
55
+
56
56
  # Rails 2.3
57
57
  storage_units:
58
58
  # Storage units output formatting.
@@ -1,16 +1,16 @@
1
1
  ru:
2
2
  # Используется в array.to_sentence
3
- #
4
- #
3
+ #
4
+ #
5
5
  # Used in array.to_sentence.
6
6
  support:
7
7
  array:
8
8
  # Rails 2.2
9
9
  sentence_connector: "и"
10
10
  skip_last_comma: true
11
-
11
+
12
12
  # Rails 2.3
13
13
  words_connector: ", "
14
14
  two_words_connector: " и "
15
15
  last_word_connector: " и "
16
-
16
+
@@ -12,7 +12,7 @@ ru:
12
12
  default: "%d.%m.%Y"
13
13
  short: "%d %b"
14
14
  long: "%d %B %Y"
15
-
15
+
16
16
  # Названия дней недели -- контекстные и отдельностоящие
17
17
  day_names: [воскресенье, понедельник, вторник, среда, четверг, пятница, суббота]
18
18
  standalone_day_names: [Воскресенье, Понедельник, Вторник, Среда, Четверг, Пятница, Суббота]
@@ -20,19 +20,19 @@ ru:
20
20
 
21
21
  # Названия месяцев -- сокращенные и полные, плюс отдельностоящие.
22
22
  # Не забудьте nil в начале массиве (~)
23
- #
23
+ #
24
24
  #
25
25
  # Don't forget the nil at the beginning; there's no such thing as a 0th month
26
26
  month_names: [~, января, февраля, марта, апреля, мая, июня, июля, августа, сентября, октября, ноября, декабря]
27
27
  standalone_month_names: [~, Январь, Февраль, Март, Апрель, Май, Июнь, Июль, Август, Сентябрь, Октябрь, Ноябрь, Декабрь]
28
28
  abbr_month_names: [~, янв., февр., марта, апр., мая, июня, июля, авг., сент., окт., нояб., дек.]
29
29
  standalone_abbr_month_names: [~, янв., февр., март, апр., май, июнь, июль, авг., сент., окт., нояб., дек.]
30
-
30
+
31
31
  # Порядок компонентов даты для хелперов
32
32
  #
33
33
  #
34
34
  # Used in date_select and datime_select.
35
- order:
35
+ order:
36
36
  - :day
37
37
  - :month
38
38
  - :year
@@ -43,7 +43,7 @@ ru:
43
43
  default: "%a, %d %b %Y, %H:%M:%S %z"
44
44
  short: "%d %b, %H:%M"
45
45
  long: "%d %B %Y, %H:%M"
46
-
46
+
47
47
  # am/pm решено перевести как "утра/вечера" :)
48
48
  am: "утра"
49
49
  pm: "вечера"
@@ -47,7 +47,7 @@ class Time
47
47
  #
48
48
  def distance_of_time_in_words(to_time = 0, include_seconds = false, options = {})
49
49
  from_time = self
50
-
50
+
51
51
  from_time = from_time.to_time if from_time.respond_to?(:to_time)
52
52
  to_time = to_time.to_time if to_time.respond_to?(:to_time)
53
53
  distance_in_minutes = (((to_time - from_time).abs)/60).round
@@ -90,7 +90,7 @@ class Time
90
90
  end
91
91
  end
92
92
  end
93
-
93
+
94
94
  # Like distance_of_time_in_words, but where <tt>to_time</tt> is fixed to <tt>Time.now</tt>.
95
95
  #
96
96
  # ==== Examples