lolita 3.1.10 → 3.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -5
- data/.rspec +2 -2
- data/GUIDELINES.rdoc +24 -24
- data/Gemfile +26 -26
- data/History.rdoc +162 -154
- data/LICENSE.txt +22 -22
- data/README.rdoc +98 -98
- data/Rakefile +40 -40
- data/VERSION +1 -1
- data/app/controllers/lolita/info_controller.rb +41 -41
- data/app/controllers/lolita/rest_controller.rb +130 -130
- data/app/helpers/components/lolita/configuration/list_component.rb +10 -10
- data/app/helpers/lolita_helper.rb +11 -11
- data/app/views/components/lolita/configuration/column/_display.html.erb +4 -4
- data/app/views/components/lolita/configuration/column/_header.html.erb +7 -7
- data/app/views/components/lolita/configuration/column/_sort.html.erb +4 -4
- data/app/views/components/lolita/configuration/columns/_body.html.erb +4 -4
- data/app/views/components/lolita/configuration/columns/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/columns/_first.html.erb +2 -2
- data/app/views/components/lolita/configuration/columns/_first_column_header.html.erb +3 -3
- data/app/views/components/lolita/configuration/columns/_header.html.erb +8 -8
- data/app/views/components/lolita/configuration/columns/_last.html.erb +4 -4
- data/app/views/components/lolita/configuration/columns/_last_column_header.html.erb +2 -2
- data/app/views/components/lolita/configuration/columns/_row.html.erb +7 -7
- data/app/views/components/lolita/configuration/field/_display.html.erb +9 -9
- data/app/views/components/lolita/configuration/field/_label.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/_object.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/array/_display.html.erb +4 -4
- data/app/views/components/lolita/configuration/field/array/habtm/_display.html.erb +26 -26
- data/app/views/components/lolita/configuration/field/array/select/_display.html.erb +5 -5
- data/app/views/components/lolita/configuration/field/boolean/filter/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/date/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/date_time/date/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/integer/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/string/_display.html.erb +4 -4
- data/app/views/components/lolita/configuration/field/string/disabled/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/string/password/_display.html.erb +3 -3
- data/app/views/components/lolita/configuration/field/string/text/_display.html.erb +18 -18
- data/app/views/components/lolita/configuration/field_set/_display.html.erb +5 -5
- data/app/views/components/lolita/configuration/list/_display.html.erb +10 -10
- data/app/views/components/lolita/configuration/list/_filter.html.erb +7 -7
- data/app/views/components/lolita/configuration/list/_new_resource.html.erb +4 -4
- data/app/views/components/lolita/configuration/list/_title.html.erb +4 -4
- data/app/views/components/lolita/configuration/tab/_display.html.erb +17 -17
- data/app/views/components/lolita/configuration/tab/_fields.html.erb +6 -6
- data/app/views/components/lolita/configuration/tab/content/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/tab/default/_display.html.erb +8 -8
- data/app/views/components/lolita/configuration/tabs/_display.html.erb +10 -10
- data/app/views/components/lolita/navigation/_display.html.erb +2 -2
- data/app/views/components/lolita/navigation/_tree.html.erb +38 -38
- data/app/views/components/lolita/shared/_flash.html.erb +5 -5
- data/app/views/components/lolita/shared/_header.html.erb +8 -8
- data/app/views/components/lolita/shared/_right_sidebar.html.erb +13 -13
- data/app/views/layouts/lolita/application.html.erb +44 -44
- data/app/views/lolita/info/index.html.erb +232 -232
- data/app/views/lolita/rest/form.html.erb +1 -1
- data/app/views/lolita/rest/index.html.erb +1 -1
- data/author +1 -1
- data/config/locales/default/lv.yml +180 -180
- data/config/locales/en.yml +20 -20
- data/config/locales/lv.yml +20 -20
- data/config/routes.rb +3 -3
- data/db/seed.rb +1 -1
- data/features/create_page.feature +19 -19
- data/features/step_definitions/lolita_steps.rb +7 -7
- data/features/step_definitions/web_steps.rb +219 -219
- data/features/support/env.rb +73 -73
- data/features/support/paths.rb +35 -35
- data/lib/generators/helpers/file_helper.rb +22 -22
- data/lib/generators/lolita/assets_generator.rb +18 -18
- data/lib/generators/lolita/install_generator.rb +28 -28
- data/lib/generators/templates/lolita.rb +19 -19
- data/lib/lolita.rb +184 -184
- data/lib/lolita/adapter/abstract_adapter.rb +13 -13
- data/lib/lolita/adapter/active_record.rb +148 -148
- data/lib/lolita/adapter/mongoid.rb +127 -127
- data/lib/lolita/base_configuration.rb +165 -165
- data/lib/lolita/builder.rb +249 -249
- data/lib/lolita/configuration/base.rb +76 -76
- data/lib/lolita/configuration/column.rb +93 -94
- data/lib/lolita/configuration/columns.rb +66 -66
- data/lib/lolita/configuration/factory.rb +55 -55
- data/lib/lolita/configuration/field.rb +216 -216
- data/lib/lolita/configuration/field/array.rb +75 -75
- data/lib/lolita/configuration/field/big_decimal.rb +12 -12
- data/lib/lolita/configuration/field/boolean.rb +12 -12
- data/lib/lolita/configuration/field/date.rb +12 -12
- data/lib/lolita/configuration/field/date_time.rb +13 -13
- data/lib/lolita/configuration/field/integer.rb +12 -12
- data/lib/lolita/configuration/field/string.rb +13 -13
- data/lib/lolita/configuration/field/time.rb +13 -13
- data/lib/lolita/configuration/field_set.rb +25 -25
- data/lib/lolita/configuration/fields.rb +35 -35
- data/lib/lolita/configuration/filter.rb +108 -108
- data/lib/lolita/configuration/list.rb +104 -104
- data/lib/lolita/configuration/page.rb +125 -124
- data/lib/lolita/configuration/tab.rb +187 -187
- data/lib/lolita/configuration/tab/content.rb +21 -21
- data/lib/lolita/configuration/tab/default.rb +25 -25
- data/lib/lolita/configuration/tabs.rb +132 -132
- data/lib/lolita/controllers/component_helpers.rb +127 -127
- data/lib/lolita/controllers/internal_helpers.rb +109 -109
- data/lib/lolita/controllers/url_helpers.rb +111 -111
- data/lib/lolita/controllers/user_helpers.rb +32 -32
- data/lib/lolita/controllers/view_user_helpers.rb +12 -12
- data/lib/lolita/dbi/base.rb +50 -50
- data/lib/lolita/errors.rb +12 -12
- data/lib/lolita/hooks.rb +355 -355
- data/lib/lolita/hooks/named_hook.rb +125 -125
- data/lib/lolita/lazy_loader.rb +46 -46
- data/lib/lolita/mapping.rb +55 -55
- data/lib/lolita/modules.rb +6 -6
- data/lib/lolita/modules/rest.rb +10 -10
- data/lib/lolita/navigation/branch.rb +132 -132
- data/lib/lolita/navigation/tree.rb +116 -116
- data/lib/lolita/observed_array.rb +74 -74
- data/lib/lolita/rails.rb +20 -20
- data/lib/lolita/rails/all.rb +10 -10
- data/lib/lolita/rails/routes.rb +133 -133
- data/lib/lolita/ruby_ext/accessors.rb +26 -26
- data/lib/lolita/support/formatter.rb +62 -62
- data/lib/lolita/support/formatter/rails.rb +56 -56
- data/lib/lolita/test/matchers.rb +77 -77
- data/lolita.gemspec +2 -2
- data/public/javascripts/jquery-1.6.min.js +15 -15
- data/public/javascripts/jquery-ui-1.8.13.min.js +407 -407
- data/public/javascripts/lolita/main.js +39 -39
- data/public/javascripts/lolita/tab.js +41 -41
- data/public/javascripts/modernizr-1.7.min.js +1 -1
- data/public/javascripts/rails.js +137 -137
- data/public/javascripts/tinymce/langs/en.js +221 -221
- data/public/javascripts/tinymce/license.txt +504 -504
- data/public/javascripts/tinymce/themes/advanced/about.htm +52 -52
- data/public/javascripts/tinymce/themes/advanced/anchor.htm +26 -26
- data/public/javascripts/tinymce/themes/advanced/charmap.htm +51 -51
- data/public/javascripts/tinymce/themes/advanced/color_picker.htm +74 -74
- data/public/javascripts/tinymce/themes/advanced/editor_template_src.js +1328 -1328
- data/public/javascripts/tinymce/themes/advanced/image.htm +80 -80
- data/public/javascripts/tinymce/themes/advanced/js/about.js +73 -73
- data/public/javascripts/tinymce/themes/advanced/js/anchor.js +42 -42
- data/public/javascripts/tinymce/themes/advanced/js/charmap.js +354 -354
- data/public/javascripts/tinymce/themes/advanced/js/color_picker.js +329 -329
- data/public/javascripts/tinymce/themes/advanced/js/image.js +247 -247
- data/public/javascripts/tinymce/themes/advanced/js/link.js +153 -153
- data/public/javascripts/tinymce/themes/advanced/js/source_editor.js +56 -56
- data/public/javascripts/tinymce/themes/advanced/langs/en.js +68 -68
- data/public/javascripts/tinymce/themes/advanced/langs/en_dlg.js +53 -53
- data/public/javascripts/tinymce/themes/advanced/link.htm +57 -57
- data/public/javascripts/tinymce/themes/advanced/shortcuts.htm +47 -47
- data/public/javascripts/tinymce/themes/advanced/skins/cirkuit/content.css +66 -66
- data/public/javascripts/tinymce/themes/advanced/skins/cirkuit/dialog.css +117 -117
- data/public/javascripts/tinymce/themes/advanced/skins/cirkuit/ui.css +988 -988
- data/public/javascripts/tinymce/themes/advanced/source_editor.htm +25 -25
- data/public/javascripts/tinymce/tiny_mce_popup.js +4 -4
- data/public/javascripts/tinymce_config.js +15 -15
- data/public/stylesheets/lolita/default.css +169 -169
- data/public/stylesheets/lolita/style.css +253 -253
- data/spec/adapter_helper.rb +43 -43
- data/spec/builder_spec.rb +120 -120
- data/spec/configuration/base_spec.rb +44 -44
- data/spec/configuration/column_spec.rb +89 -89
- data/spec/configuration/columns_spec.rb +54 -54
- data/spec/configuration/field_set_spec.rb +12 -12
- data/spec/configuration/field_spec.rb +118 -118
- data/spec/configuration/filter_spec.rb +122 -122
- data/spec/configuration/list_spec.rb +76 -76
- data/spec/configuration/page_spec.rb +19 -19
- data/spec/configuration/tab_spec.rb +165 -165
- data/spec/configuration/tabs_spec.rb +106 -106
- data/spec/controllers/component_helpers_spec.rb +5 -5
- data/spec/controllers/internal_helpers_spec.rb +76 -76
- data/spec/controllers/lolita_rest_nested_resources_spec.rb +33 -33
- data/spec/controllers/lolita_rest_spec.rb +53 -53
- data/spec/dbi/base_spec.rb +44 -44
- data/spec/hooks_spec.rb +257 -257
- data/spec/lolita_spec.rb +13 -13
- data/spec/mapping_spec.rb +29 -29
- data/spec/navigation/branch_spec.rb +81 -81
- data/spec/navigation/tree_spec.rb +73 -73
- data/spec/orm/mongoid.rb +11 -11
- data/spec/rails_app/app/controllers/application_controller.rb +3 -3
- data/spec/rails_app/app/helpers/application_helper.rb +3 -3
- data/spec/rails_app/app/mongoid/address.rb +7 -7
- data/spec/rails_app/app/mongoid/category.rb +5 -5
- data/spec/rails_app/app/mongoid/comment.rb +5 -5
- data/spec/rails_app/app/mongoid/post.rb +18 -18
- data/spec/rails_app/app/mongoid/preference.rb +5 -5
- data/spec/rails_app/app/mongoid/profile.rb +13 -13
- data/spec/rails_app/app/mongoid/tag.rb +3 -3
- data/spec/rails_app/app/views/components/lolita/configuration/list/_body_cell.html.erb +1 -1
- data/spec/rails_app/config/application.rb +26 -26
- data/spec/rails_app/config/boot.rb +13 -13
- data/spec/rails_app/config/environment.rb +5 -5
- data/spec/rails_app/config/environments/development.rb +19 -19
- data/spec/rails_app/config/environments/production.rb +33 -33
- data/spec/rails_app/config/environments/test.rb +33 -33
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -7
- data/spec/rails_app/config/initializers/inflections.rb +2 -2
- data/spec/rails_app/config/initializers/secret_token.rb +1 -1
- data/spec/rails_app/config/routes.rb +2 -2
- data/spec/rails_app/lib/lolita/configuration/field/my_custom_collection.rb +13 -13
- data/spec/rails_app/public/javascripts/jquery-1.5.1.min.js +15 -15
- data/spec/rails_app/public/javascripts/lolita/main.js +6 -6
- data/spec/rails_app/public/javascripts/lolita/tab.js +40 -40
- data/spec/rails_app/public/javascripts/modernizr-1.7.min.js +1 -1
- data/spec/rails_app/public/javascripts/rails.js +137 -137
- data/spec/rails_app/public/javascripts/tinymce/langs/en.js +221 -221
- data/spec/rails_app/public/javascripts/tinymce/license.txt +504 -504
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/about.htm +52 -52
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/anchor.htm +26 -26
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/charmap.htm +51 -51
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/color_picker.htm +74 -74
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/editor_template_src.js +1328 -1328
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/image.htm +80 -80
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/js/about.js +73 -73
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/js/anchor.js +42 -42
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/js/charmap.js +354 -354
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/js/color_picker.js +329 -329
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/js/image.js +247 -247
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/js/link.js +153 -153
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/js/source_editor.js +56 -56
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/langs/en.js +68 -68
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/langs/en_dlg.js +53 -53
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/link.htm +57 -57
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/shortcuts.htm +47 -47
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/skins/cirkuit/content.css +66 -66
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/skins/cirkuit/dialog.css +117 -117
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/skins/cirkuit/ui.css +988 -988
- data/spec/rails_app/public/javascripts/tinymce/themes/advanced/source_editor.htm +25 -25
- data/spec/rails_app/public/javascripts/tinymce/tiny_mce_popup.js +4 -4
- data/spec/rails_app/public/stylesheets/lolita/default.css +169 -169
- data/spec/rails_app/public/stylesheets/lolita/style.css +214 -214
- data/spec/routing/routes_spec.rb +15 -15
- data/spec/spec_helper.rb +46 -46
- data/spec/support/factories/category.rb +3 -3
- data/spec/support/factories/post.rb +4 -4
- data/spec/support/factories/tag.rb +2 -2
- data/spec/support/formatter_spec.rb +42 -42
- metadata +31 -31
data/spec/routing/routes_spec.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe "Default Lolita routes" do
|
4
|
-
|
5
|
-
it "should have routes for posts" do
|
6
|
-
# ActionController::Routing::Routes.routes.each do |r|
|
7
|
-
# puts r
|
8
|
-
# end
|
9
|
-
# ActionController::Routing::Routes.named_routes.routes.each do |name, route|
|
10
|
-
# puts "%20s: %s" % [name, route]
|
11
|
-
# end
|
12
|
-
{:get=>'/lolita/posts'}.should be_routable
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe "Default Lolita routes" do
|
4
|
+
|
5
|
+
it "should have routes for posts" do
|
6
|
+
# ActionController::Routing::Routes.routes.each do |r|
|
7
|
+
# puts r
|
8
|
+
# end
|
9
|
+
# ActionController::Routing::Routes.named_routes.routes.each do |name, route|
|
10
|
+
# puts "%20s: %s" % [name, route]
|
11
|
+
# end
|
12
|
+
{:get=>'/lolita/posts'}.should be_routable
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
data/spec/spec_helper.rb
CHANGED
@@ -1,47 +1,47 @@
|
|
1
|
-
#require 'cover_me'
|
2
|
-
#CoverMe.config do |c|
|
3
|
-
# # where is your project's root:
|
4
|
-
# c.project.root="c:/a_work/ruby_docs/lolita3" # => "Rails.root" (default)
|
5
|
-
#
|
6
|
-
# # what files are you interested in coverage for:
|
7
|
-
# #c.file_pattern # => /(#{CoverMe.config.project.root}\/app\/.+\.rb|#{CoverMe.config.project.root}\/lib\/.+\.rb)/i (default)
|
8
|
-
#
|
9
|
-
# # where do you want the HTML generated:
|
10
|
-
# c.html_formatter.output_path # => File.join(CoverMe.config.project.root, 'coverage') (default)
|
11
|
-
#
|
12
|
-
# # what do you want to happen when it finishes:
|
13
|
-
# c.at_exit # => Proc.new {
|
14
|
-
# if CoverMe.config.formatter == CoverMe::HtmlFormatter
|
15
|
-
# index = File.join(CoverMe.config.html_formatter.output_path, 'index.html')
|
16
|
-
# if File.exists?(index)
|
17
|
-
# `open #{index}`
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
#
|
21
|
-
#end
|
22
|
-
|
23
|
-
require 'rubygems'
|
24
|
-
#require 'ruby-debug'
|
25
|
-
LOLITA_ORM=:mongoid
|
26
|
-
require "orm/#{LOLITA_ORM}"
|
27
|
-
require "rails"
|
28
|
-
require "rails_app/config/environment"
|
29
|
-
require 'rspec/rails'
|
30
|
-
require 'ffaker'
|
31
|
-
require 'factory_girl'
|
32
|
-
|
33
|
-
Dir["#{File.dirname(__FILE__)}/support/factories/**/*.rb"].each {|f| require f}
|
34
|
-
RSpec.configure do |config|
|
35
|
-
# config.mock_with :mocha
|
36
|
-
# config.mock_with :flexmock
|
37
|
-
# config.mock_with :rr
|
38
|
-
config.mock_with :rspec
|
39
|
-
|
40
|
-
if LOLITA_ORM==:active_record
|
41
|
-
#config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
42
|
-
config.use_transactional_fixtures = true
|
43
|
-
end
|
44
|
-
end
|
45
|
-
#CoverMe.complete!
|
46
|
-
#require 'simplecov'
|
1
|
+
#require 'cover_me'
|
2
|
+
#CoverMe.config do |c|
|
3
|
+
# # where is your project's root:
|
4
|
+
# c.project.root="c:/a_work/ruby_docs/lolita3" # => "Rails.root" (default)
|
5
|
+
#
|
6
|
+
# # what files are you interested in coverage for:
|
7
|
+
# #c.file_pattern # => /(#{CoverMe.config.project.root}\/app\/.+\.rb|#{CoverMe.config.project.root}\/lib\/.+\.rb)/i (default)
|
8
|
+
#
|
9
|
+
# # where do you want the HTML generated:
|
10
|
+
# c.html_formatter.output_path # => File.join(CoverMe.config.project.root, 'coverage') (default)
|
11
|
+
#
|
12
|
+
# # what do you want to happen when it finishes:
|
13
|
+
# c.at_exit # => Proc.new {
|
14
|
+
# if CoverMe.config.formatter == CoverMe::HtmlFormatter
|
15
|
+
# index = File.join(CoverMe.config.html_formatter.output_path, 'index.html')
|
16
|
+
# if File.exists?(index)
|
17
|
+
# `open #{index}`
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
#end
|
22
|
+
|
23
|
+
require 'rubygems'
|
24
|
+
#require 'ruby-debug'
|
25
|
+
LOLITA_ORM=:mongoid
|
26
|
+
require "orm/#{LOLITA_ORM}"
|
27
|
+
require "rails"
|
28
|
+
require "rails_app/config/environment"
|
29
|
+
require 'rspec/rails'
|
30
|
+
require 'ffaker'
|
31
|
+
require 'factory_girl'
|
32
|
+
|
33
|
+
Dir["#{File.dirname(__FILE__)}/support/factories/**/*.rb"].each {|f| require f}
|
34
|
+
RSpec.configure do |config|
|
35
|
+
# config.mock_with :mocha
|
36
|
+
# config.mock_with :flexmock
|
37
|
+
# config.mock_with :rr
|
38
|
+
config.mock_with :rspec
|
39
|
+
|
40
|
+
if LOLITA_ORM==:active_record
|
41
|
+
#config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
42
|
+
config.use_transactional_fixtures = true
|
43
|
+
end
|
44
|
+
end
|
45
|
+
#CoverMe.complete!
|
46
|
+
#require 'simplecov'
|
47
47
|
#SimpleCov.start 'rails'
|
@@ -1,3 +1,3 @@
|
|
1
|
-
Factory.define(:category, :class=>Category) do |f|
|
2
|
-
f.name Faker::Name.name
|
3
|
-
end
|
1
|
+
Factory.define(:category, :class=>Category) do |f|
|
2
|
+
f.name Faker::Name.name
|
3
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Factory.define(:post, :class=>Post) do |f|
|
2
|
-
f.title Faker::Lorem.sentence
|
3
|
-
f.association :category
|
4
|
-
end
|
1
|
+
Factory.define(:post, :class=>Post) do |f|
|
2
|
+
f.title Faker::Lorem.sentence
|
3
|
+
f.association :category
|
4
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
Factory.define(:tag) do |f|
|
2
|
-
f.name Faker::Name.name
|
1
|
+
Factory.define(:tag) do |f|
|
2
|
+
f.name Faker::Name.name
|
3
3
|
end
|
@@ -1,42 +1,42 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../simple_spec_helper')
|
2
|
-
|
3
|
-
describe Lolita::Support::Formatter do
|
4
|
-
let(:klass){Lolita::Support::Formatter}
|
5
|
-
|
6
|
-
context "create new" do
|
7
|
-
|
8
|
-
it "should accept value as format" do
|
9
|
-
formatter=klass.new("%Y-%m")
|
10
|
-
formatter.format.should == "%Y-%m"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should accept block" do
|
14
|
-
formatter=klass.new do |value|
|
15
|
-
value**2
|
16
|
-
end
|
17
|
-
formatter.block.should_not be_nil
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
context "calling formatter" do
|
22
|
-
it "should call block" do
|
23
|
-
formatter=klass.new do |value|
|
24
|
-
value.to_i+1
|
25
|
-
end
|
26
|
-
formatter.with(2).should == 3
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should try to call #format method on given value" do
|
30
|
-
formatter=klass.new("M")
|
31
|
-
object=mock(Object)
|
32
|
-
object.stub!(:format).and_return(1)
|
33
|
-
object.stub!(:respond_to?).with(:format).and_return(true)
|
34
|
-
formatter.with(object).should == 1
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should convert received value to string and call #unpack" do
|
38
|
-
formatter=klass.new("%.3f")
|
39
|
-
formatter.with(44.88).should == "44.880"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../simple_spec_helper')
|
2
|
+
|
3
|
+
describe Lolita::Support::Formatter do
|
4
|
+
let(:klass){Lolita::Support::Formatter}
|
5
|
+
|
6
|
+
context "create new" do
|
7
|
+
|
8
|
+
it "should accept value as format" do
|
9
|
+
formatter=klass.new("%Y-%m")
|
10
|
+
formatter.format.should == "%Y-%m"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should accept block" do
|
14
|
+
formatter=klass.new do |value|
|
15
|
+
value**2
|
16
|
+
end
|
17
|
+
formatter.block.should_not be_nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context "calling formatter" do
|
22
|
+
it "should call block" do
|
23
|
+
formatter=klass.new do |value|
|
24
|
+
value.to_i+1
|
25
|
+
end
|
26
|
+
formatter.with(2).should == 3
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should try to call #format method on given value" do
|
30
|
+
formatter=klass.new("M")
|
31
|
+
object=mock(Object)
|
32
|
+
object.stub!(:format).and_return(1)
|
33
|
+
object.stub!(:respond_to?).with(:format).and_return(true)
|
34
|
+
formatter.with(object).should == 1
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should convert received value to string and call #unpack" do
|
38
|
+
formatter=klass.new("%.3f")
|
39
|
+
formatter.with(44.88).should == "44.880"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-07-
|
12
|
+
date: 2011-07-15 00:00:00.000000000 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &82827030 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.0.7
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *82827030
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: kaminari
|
28
|
-
requirement: &
|
28
|
+
requirement: &82826440 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.12.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *82826440
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: abstract
|
39
|
-
requirement: &
|
39
|
+
requirement: &82825690 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *82825690
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: builder
|
50
|
-
requirement: &
|
50
|
+
requirement: &82824830 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 2.1.2
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *82824830
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: jeweler
|
61
|
-
requirement: &
|
61
|
+
requirement: &82823920 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 1.5.2
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *82823920
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
|
-
requirement: &
|
72
|
+
requirement: &82823110 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 2.6.0
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *82823110
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rspec-rails
|
83
|
-
requirement: &
|
83
|
+
requirement: &82822330 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: 2.6.0
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *82822330
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: factory_girl
|
94
|
-
requirement: &
|
94
|
+
requirement: &82796720 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
@@ -99,10 +99,10 @@ dependencies:
|
|
99
99
|
version: '0'
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *82796720
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: ffaker
|
105
|
-
requirement: &
|
105
|
+
requirement: &82796060 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
@@ -110,10 +110,10 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *82796060
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: ruby-debug19
|
116
|
-
requirement: &
|
116
|
+
requirement: &82794650 !ruby/object:Gem::Requirement
|
117
117
|
none: false
|
118
118
|
requirements:
|
119
119
|
- - ! '>='
|
@@ -121,10 +121,10 @@ dependencies:
|
|
121
121
|
version: '0'
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
|
-
version_requirements: *
|
124
|
+
version_requirements: *82794650
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: cucumber-rails
|
127
|
-
requirement: &
|
127
|
+
requirement: &82793470 !ruby/object:Gem::Requirement
|
128
128
|
none: false
|
129
129
|
requirements:
|
130
130
|
- - ! '>='
|
@@ -132,10 +132,10 @@ dependencies:
|
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
|
-
version_requirements: *
|
135
|
+
version_requirements: *82793470
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: capybara
|
138
|
-
requirement: &
|
138
|
+
requirement: &82792730 !ruby/object:Gem::Requirement
|
139
139
|
none: false
|
140
140
|
requirements:
|
141
141
|
- - ! '>='
|
@@ -143,10 +143,10 @@ dependencies:
|
|
143
143
|
version: '0'
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
|
-
version_requirements: *
|
146
|
+
version_requirements: *82792730
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: database_cleaner
|
149
|
-
requirement: &
|
149
|
+
requirement: &82792260 !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
152
152
|
- - ! '>='
|
@@ -154,10 +154,10 @@ dependencies:
|
|
154
154
|
version: '0'
|
155
155
|
type: :development
|
156
156
|
prerelease: false
|
157
|
-
version_requirements: *
|
157
|
+
version_requirements: *82792260
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: akephalos
|
160
|
-
requirement: &
|
160
|
+
requirement: &82791050 !ruby/object:Gem::Requirement
|
161
161
|
none: false
|
162
162
|
requirements:
|
163
163
|
- - ! '>='
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
version: '0'
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
|
-
version_requirements: *
|
168
|
+
version_requirements: *82791050
|
169
169
|
description: ! 'Great Rails CMS, that turns your business logic into good-looking,
|
170
170
|
fully functional workspace. '
|
171
171
|
email: support@ithouse.lv
|
@@ -498,7 +498,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
498
498
|
version: '0'
|
499
499
|
segments:
|
500
500
|
- 0
|
501
|
-
hash: -
|
501
|
+
hash: -966399281
|
502
502
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
503
503
|
none: false
|
504
504
|
requirements:
|