lolita-menu 0.3.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +47 -0
- data/Gemfile +8 -11
- data/Rakefile +4 -43
- data/app/assets/javascripts/lolita/menu/autocomplete-rails.js +1 -1
- data/app/assets/javascripts/lolita/menu/menu-items.js +5 -5
- data/app/assets/stylesheets/lolita/menu/application.css +21 -0
- data/app/controllers/menu_items_controller.rb +4 -0
- data/app/controllers/nested_trees_controller.rb +46 -46
- data/app/models/menu.rb +1 -7
- data/app/models/menu_item.rb +13 -17
- data/app/views/components/lolita/menu/nested_tree/_display.html.haml +0 -1
- data/lib/generators/lolita/menu/templates/migrations/create_menu_items.rb +1 -1
- data/lib/lolita-menu/nested_tree.rb +253 -253
- data/lib/lolita-menu/nested_tree/branch_builder.rb +58 -58
- data/lib/lolita-menu/nested_tree/configuration.rb +72 -72
- data/lib/lolita-menu/nested_tree/scope.rb +52 -52
- data/lib/lolita-menu/nested_tree/tree_builder.rb +29 -29
- data/lolita-menu.gemspec +6 -110
- data/spec/models/menu_item_spec.rb +6 -6
- data/spec/models/menu_spec.rb +0 -1
- data/test_orm/active_record.rb +4 -6
- data/test_orm/log/.gitkeep +0 -0
- data/test_orm/rails/config/application.rb +2 -3
- data/test_orm/rails/log/.gitkeep +0 -0
- metadata +34 -129
data/lolita-menu.gemspec
CHANGED
@@ -1,130 +1,26 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
5
3
|
|
6
4
|
Gem::Specification.new do |s|
|
7
5
|
s.name = "lolita-menu"
|
8
|
-
s.version = "0.
|
6
|
+
s.version = "0.4.0"
|
9
7
|
|
10
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
9
|
s.authors = ["ITHouse", "Arturs Meisters"]
|
12
|
-
s.date = "2012-11-08"
|
13
10
|
s.description = "Manage public menus for each project inside Lolita."
|
14
11
|
s.email = "support@ithouse.lv"
|
15
12
|
s.extra_rdoc_files = [
|
16
13
|
"LICENSE.txt",
|
17
14
|
"README.rdoc"
|
18
15
|
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".rspec",
|
22
|
-
"Gemfile",
|
23
|
-
"History.rdoc",
|
24
|
-
"LICENSE.txt",
|
25
|
-
"README.rdoc",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"app/assets/images/lolita/menu/delete.png",
|
29
|
-
"app/assets/images/lolita/menu/move.png",
|
30
|
-
"app/assets/javascripts/lolita/menu/application.js",
|
31
|
-
"app/assets/javascripts/lolita/menu/autocomplete-rails.js",
|
32
|
-
"app/assets/javascripts/lolita/menu/jquery-ui-nested-sortables.js",
|
33
|
-
"app/assets/javascripts/lolita/menu/menu-items.js",
|
34
|
-
"app/assets/stylesheets/lolita/menu/application.css",
|
35
|
-
"app/controllers/menu_items_controller.rb",
|
36
|
-
"app/controllers/nested_trees_controller.rb",
|
37
|
-
"app/helpers/lolita/menu_helper.rb",
|
38
|
-
"app/models/menu.rb",
|
39
|
-
"app/models/menu_item.rb",
|
40
|
-
"app/views/components/lolita/menu/nested_tree/_columns.html.haml",
|
41
|
-
"app/views/components/lolita/menu/nested_tree/_columns_body.html.haml",
|
42
|
-
"app/views/components/lolita/menu/nested_tree/_display.html.haml",
|
43
|
-
"app/views/components/lolita/menu/nested_tree/_unscoped_body.html.haml",
|
44
|
-
"app/views/components/lolita/menu/nested_tree/branch_builder/_display.html.haml",
|
45
|
-
"app/views/components/lolita/menu/nested_tree/branch_builder/_fields.html.haml",
|
46
|
-
"app/views/components/lolita/menu/nested_tree/branch_builder/_row.html.haml",
|
47
|
-
"app/views/components/lolita/menu/nested_tree/branch_builder/_subtree.html.haml",
|
48
|
-
"app/views/components/lolita/menu_item/_display.html.haml",
|
49
|
-
"config/locales/en.yml",
|
50
|
-
"config/locales/lv.yml",
|
51
|
-
"config/routes.rb",
|
52
|
-
"lib/generators/lolita/menu/install_generator.rb",
|
53
|
-
"lib/generators/lolita/menu/templates/lolita-menu-urls.rb",
|
54
|
-
"lib/generators/lolita/menu/templates/migrations/create_menu_items.rb",
|
55
|
-
"lib/generators/lolita/menu/templates/migrations/create_menus.rb",
|
56
|
-
"lib/lolita-menu.rb",
|
57
|
-
"lib/lolita-menu/autocomplete/collector.rb",
|
58
|
-
"lib/lolita-menu/autocomplete/file_builder.rb",
|
59
|
-
"lib/lolita-menu/autocomplete/link_set.rb",
|
60
|
-
"lib/lolita-menu/configuration.rb",
|
61
|
-
"lib/lolita-menu/module.rb",
|
62
|
-
"lib/lolita-menu/nested_tree.rb",
|
63
|
-
"lib/lolita-menu/nested_tree/branch_builder.rb",
|
64
|
-
"lib/lolita-menu/nested_tree/configuration.rb",
|
65
|
-
"lib/lolita-menu/nested_tree/scope.rb",
|
66
|
-
"lib/lolita-menu/nested_tree/tree_builder.rb",
|
67
|
-
"lib/lolita-menu/rails.rb",
|
68
|
-
"lib/lolita-menu/railtie.rb",
|
69
|
-
"lib/tasks/lolita-menu.rake",
|
70
|
-
"lolita-menu.gemspec",
|
71
|
-
"spec/branch_builder_spec.rb",
|
72
|
-
"spec/models/menu_item_spec.rb",
|
73
|
-
"spec/models/menu_spec.rb",
|
74
|
-
"spec/nested_tree_spec.rb",
|
75
|
-
"spec/spec_helper.rb",
|
76
|
-
"spec/tree_builder_spec.rb",
|
77
|
-
"test_orm/active_record.rb",
|
78
|
-
"test_orm/db/migrate/01_create_lolita_menus.rb",
|
79
|
-
"test_orm/db/migrate/02_create_lolita_menu_items.rb",
|
80
|
-
"test_orm/db/migrate/03_create_categories.rb",
|
81
|
-
"test_orm/db/migrate/04_create_btrees.rb",
|
82
|
-
"test_orm/db/migrate/05_create_shops.rb",
|
83
|
-
"test_orm/rails/app/models/btree.rb",
|
84
|
-
"test_orm/rails/app/models/category.rb",
|
85
|
-
"test_orm/rails/app/models/shop.rb",
|
86
|
-
"test_orm/rails/config/application.rb",
|
87
|
-
"test_orm/rails/config/boot.rb",
|
88
|
-
"test_orm/rails/config/database.yml",
|
89
|
-
"test_orm/rails/config/enviroment.rb"
|
90
|
-
]
|
91
16
|
s.homepage = "http://github.com/ithouse/lolita-menu"
|
92
17
|
s.licenses = ["MIT"]
|
93
18
|
s.require_paths = ["lib"]
|
94
|
-
s.rubygems_version = "1.8.24"
|
95
19
|
s.summary = "Menu managing plugin for Lolita."
|
96
20
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
s.add_runtime_dependency(%q<lolita>, ["~> 3.2.0.rc.14"])
|
102
|
-
s.add_development_dependency(%q<rails>, ["~> 3.2.0"])
|
103
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.9.0"])
|
104
|
-
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
105
|
-
s.add_development_dependency(%q<rspec-rails>, ["~> 2.9.0"])
|
106
|
-
s.add_development_dependency(%q<haml-rails>, [">= 0"])
|
107
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
|
108
|
-
s.add_development_dependency(%q<database_cleaner>, ["~> 0.6.7"])
|
109
|
-
else
|
110
|
-
s.add_dependency(%q<lolita>, ["~> 3.2.0.rc.14"])
|
111
|
-
s.add_dependency(%q<rails>, ["~> 3.2.0"])
|
112
|
-
s.add_dependency(%q<rspec>, ["~> 2.9.0"])
|
113
|
-
s.add_dependency(%q<sqlite3>, [">= 0"])
|
114
|
-
s.add_dependency(%q<rspec-rails>, ["~> 2.9.0"])
|
115
|
-
s.add_dependency(%q<haml-rails>, [">= 0"])
|
116
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
117
|
-
s.add_dependency(%q<database_cleaner>, ["~> 0.6.7"])
|
118
|
-
end
|
119
|
-
else
|
120
|
-
s.add_dependency(%q<lolita>, ["~> 3.2.0.rc.14"])
|
121
|
-
s.add_dependency(%q<rails>, ["~> 3.2.0"])
|
122
|
-
s.add_dependency(%q<rspec>, ["~> 2.9.0"])
|
123
|
-
s.add_dependency(%q<sqlite3>, [">= 0"])
|
124
|
-
s.add_dependency(%q<rspec-rails>, ["~> 2.9.0"])
|
125
|
-
s.add_dependency(%q<haml-rails>, [">= 0"])
|
126
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
127
|
-
s.add_dependency(%q<database_cleaner>, ["~> 0.6.7"])
|
128
|
-
end
|
21
|
+
s.add_runtime_dependency(%q<lolita>, ["~> 3.3.1"])
|
22
|
+
s.files = `git ls-files`.split("\n")
|
23
|
+
s.test_files = `git ls-files -- {test_orm,spec}/*`.split("\n")
|
24
|
+
s.require_paths = ["lib"]
|
129
25
|
end
|
130
26
|
|
@@ -11,27 +11,27 @@ describe MenuItem do
|
|
11
11
|
let(:menu){Menu.create!(:name=>"new menu")}
|
12
12
|
|
13
13
|
let(:request){
|
14
|
-
mock_obj =
|
15
|
-
mock_obj.stub
|
14
|
+
mock_obj = double
|
15
|
+
mock_obj.stub(:params).and_return({})
|
16
16
|
mock_obj
|
17
17
|
}
|
18
18
|
|
19
19
|
it "should recognize full paths" do
|
20
20
|
item = menu.append(MenuItem.create!(:name => "Name", :url => "http://google.lv"))
|
21
|
-
request.stub
|
21
|
+
request.stub(:url).and_return("http://google.lv")
|
22
22
|
item.active?(request).should be_true
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should recognize relative paths" do
|
26
26
|
item = menu.append(MenuItem.create!(:name => "Name", :url => "/posts"))
|
27
|
-
request.stub
|
27
|
+
request.stub(:path).and_return("/posts?page=1")
|
28
28
|
item.active?(request).should be_true
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should recognize relative paths with arguments" do
|
32
32
|
item = menu.append(MenuItem.create!(:name => "Name", :url => "/:whoes/posts"))
|
33
|
-
request.stub
|
34
|
-
request.stub
|
33
|
+
request.stub(:path).and_return("/my/posts?page=1")
|
34
|
+
request.stub(:params).and_return({:whoes => "my"})
|
35
35
|
item.active?(request).should be_true
|
36
36
|
end
|
37
37
|
end
|
data/spec/models/menu_spec.rb
CHANGED
data/test_orm/active_record.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'active_record'
|
2
2
|
require 'logger'
|
3
|
-
|
3
|
+
test_orm_dir = File.dirname(__FILE__)
|
4
|
+
dbconf = YAML::load(File.open(File.join(test_orm_dir, 'rails', 'config', 'database.yml')))
|
4
5
|
ActiveRecord::Base.establish_connection(dbconf["development"])
|
5
|
-
ActiveRecord::Base.logger = Logger.new(File.
|
6
|
-
ActiveRecord::Migrator.up('
|
7
|
-
#Dir[File.expand_path("test_orm/active_record/**/*.*")].each do |path|
|
8
|
-
# require path
|
9
|
-
#end
|
6
|
+
ActiveRecord::Base.logger = Logger.new(File.join(test_orm_dir, 'log', 'database.log'))
|
7
|
+
ActiveRecord::Migrator.up(File.join(test_orm_dir, 'db', 'migrate'))
|
File without changes
|
@@ -9,10 +9,9 @@ end
|
|
9
9
|
|
10
10
|
module Test
|
11
11
|
class Application < Rails::Application
|
12
|
-
config.root=File.expand_path(
|
13
|
-
config.logger=Logger.new(File.join(config.root,
|
12
|
+
config.root= File.expand_path('..', File.dirname(__FILE__))
|
13
|
+
config.logger=Logger.new(File.join(config.root, 'log', 'development.log'))
|
14
14
|
config.active_support.deprecation=:log
|
15
|
-
|
16
15
|
#config.autoload_paths=File.expand_path("../#{File.dirname(__FILE__)}")
|
17
16
|
end
|
18
17
|
end
|
File without changes
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolita-menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- ITHouse
|
@@ -10,136 +9,22 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: lolita
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
22
|
-
version: 3.
|
20
|
+
version: 3.3.1
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
version: 3.
|
31
|
-
- !ruby/object:Gem::Dependency
|
32
|
-
name: rails
|
33
|
-
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
|
-
requirements:
|
36
|
-
- - ~>
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: 3.2.0
|
39
|
-
type: :development
|
40
|
-
prerelease: false
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
|
-
requirements:
|
44
|
-
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 3.2.0
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: rspec
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 2.9.0
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
|
-
requirements:
|
60
|
-
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 2.9.0
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: sqlite3
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
|
-
requirements:
|
68
|
-
- - ! '>='
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '0'
|
71
|
-
type: :development
|
72
|
-
prerelease: false
|
73
|
-
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
|
-
requirements:
|
76
|
-
- - ! '>='
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '0'
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
|
-
name: rspec-rails
|
81
|
-
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
|
-
requirements:
|
84
|
-
- - ~>
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: 2.9.0
|
87
|
-
type: :development
|
88
|
-
prerelease: false
|
89
|
-
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
|
-
requirements:
|
92
|
-
- - ~>
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: 2.9.0
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: haml-rails
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
|
-
requirements:
|
100
|
-
- - ! '>='
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
103
|
-
type: :development
|
104
|
-
prerelease: false
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
|
-
requirements:
|
108
|
-
- - ! '>='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: jeweler
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
|
-
requirements:
|
116
|
-
- - ~>
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: 1.6.0
|
119
|
-
type: :development
|
120
|
-
prerelease: false
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
|
-
requirements:
|
124
|
-
- - ~>
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
version: 1.6.0
|
127
|
-
- !ruby/object:Gem::Dependency
|
128
|
-
name: database_cleaner
|
129
|
-
requirement: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
|
-
requirements:
|
132
|
-
- - ~>
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version: 0.6.7
|
135
|
-
type: :development
|
136
|
-
prerelease: false
|
137
|
-
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
|
-
requirements:
|
140
|
-
- - ~>
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: 0.6.7
|
27
|
+
version: 3.3.1
|
143
28
|
description: Manage public menus for each project inside Lolita.
|
144
29
|
email: support@ithouse.lv
|
145
30
|
executables: []
|
@@ -149,6 +34,7 @@ extra_rdoc_files:
|
|
149
34
|
- README.rdoc
|
150
35
|
files:
|
151
36
|
- .document
|
37
|
+
- .gitignore
|
152
38
|
- .rspec
|
153
39
|
- Gemfile
|
154
40
|
- History.rdoc
|
@@ -211,6 +97,7 @@ files:
|
|
211
97
|
- test_orm/db/migrate/03_create_categories.rb
|
212
98
|
- test_orm/db/migrate/04_create_btrees.rb
|
213
99
|
- test_orm/db/migrate/05_create_shops.rb
|
100
|
+
- test_orm/log/.gitkeep
|
214
101
|
- test_orm/rails/app/models/btree.rb
|
215
102
|
- test_orm/rails/app/models/category.rb
|
216
103
|
- test_orm/rails/app/models/shop.rb
|
@@ -218,32 +105,50 @@ files:
|
|
218
105
|
- test_orm/rails/config/boot.rb
|
219
106
|
- test_orm/rails/config/database.yml
|
220
107
|
- test_orm/rails/config/enviroment.rb
|
108
|
+
- test_orm/rails/log/.gitkeep
|
221
109
|
homepage: http://github.com/ithouse/lolita-menu
|
222
110
|
licenses:
|
223
111
|
- MIT
|
112
|
+
metadata: {}
|
224
113
|
post_install_message:
|
225
114
|
rdoc_options: []
|
226
115
|
require_paths:
|
227
116
|
- lib
|
228
117
|
required_ruby_version: !ruby/object:Gem::Requirement
|
229
|
-
none: false
|
230
118
|
requirements:
|
231
|
-
- -
|
119
|
+
- - '>='
|
232
120
|
- !ruby/object:Gem::Version
|
233
121
|
version: '0'
|
234
|
-
segments:
|
235
|
-
- 0
|
236
|
-
hash: 2827138981695883959
|
237
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
238
|
-
none: false
|
239
123
|
requirements:
|
240
|
-
- -
|
124
|
+
- - '>='
|
241
125
|
- !ruby/object:Gem::Version
|
242
126
|
version: '0'
|
243
127
|
requirements: []
|
244
128
|
rubyforge_project:
|
245
|
-
rubygems_version:
|
129
|
+
rubygems_version: 2.0.3
|
246
130
|
signing_key:
|
247
|
-
specification_version:
|
131
|
+
specification_version: 4
|
248
132
|
summary: Menu managing plugin for Lolita.
|
249
|
-
test_files:
|
133
|
+
test_files:
|
134
|
+
- spec/branch_builder_spec.rb
|
135
|
+
- spec/models/menu_item_spec.rb
|
136
|
+
- spec/models/menu_spec.rb
|
137
|
+
- spec/nested_tree_spec.rb
|
138
|
+
- spec/spec_helper.rb
|
139
|
+
- spec/tree_builder_spec.rb
|
140
|
+
- test_orm/active_record.rb
|
141
|
+
- test_orm/db/migrate/01_create_lolita_menus.rb
|
142
|
+
- test_orm/db/migrate/02_create_lolita_menu_items.rb
|
143
|
+
- test_orm/db/migrate/03_create_categories.rb
|
144
|
+
- test_orm/db/migrate/04_create_btrees.rb
|
145
|
+
- test_orm/db/migrate/05_create_shops.rb
|
146
|
+
- test_orm/log/.gitkeep
|
147
|
+
- test_orm/rails/app/models/btree.rb
|
148
|
+
- test_orm/rails/app/models/category.rb
|
149
|
+
- test_orm/rails/app/models/shop.rb
|
150
|
+
- test_orm/rails/config/application.rb
|
151
|
+
- test_orm/rails/config/boot.rb
|
152
|
+
- test_orm/rails/config/database.yml
|
153
|
+
- test_orm/rails/config/enviroment.rb
|
154
|
+
- test_orm/rails/log/.gitkeep
|