jekyll-navigation 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/.gitignore +17 -0
  2. data/.rspec +3 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +24 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +102 -0
  7. data/Rakefile +1 -0
  8. data/example-jekyll-site/_config.yml +2 -0
  9. data/example-jekyll-site/_layouts/default.html +35 -0
  10. data/example-jekyll-site/_plugins/navigation.rb +3 -0
  11. data/example-jekyll-site/_site/assets/css/bootstrap.css +6307 -0
  12. data/example-jekyll-site/_site/assets/css/bootstrap.min.css +873 -0
  13. data/example-jekyll-site/_site/assets/img/glyphicons-halflings-white.png +0 -0
  14. data/example-jekyll-site/_site/assets/img/glyphicons-halflings.png +0 -0
  15. data/example-jekyll-site/_site/assets/js/bootstrap.js +2287 -0
  16. data/example-jekyll-site/_site/assets/js/bootstrap.min.js +7 -0
  17. data/example-jekyll-site/_site/contact.html +45 -0
  18. data/example-jekyll-site/_site/digital_art.html +52 -0
  19. data/example-jekyll-site/_site/imprint.html +45 -0
  20. data/example-jekyll-site/_site/index.html +45 -0
  21. data/example-jekyll-site/_site/portfolio.html +52 -0
  22. data/example-jekyll-site/_site/traditional_art.html +52 -0
  23. data/example-jekyll-site/assets/css/bootstrap.css +6307 -0
  24. data/example-jekyll-site/assets/css/bootstrap.min.css +873 -0
  25. data/example-jekyll-site/assets/img/glyphicons-halflings-white.png +0 -0
  26. data/example-jekyll-site/assets/img/glyphicons-halflings.png +0 -0
  27. data/example-jekyll-site/assets/js/bootstrap.js +2287 -0
  28. data/example-jekyll-site/assets/js/bootstrap.min.js +7 -0
  29. data/example-jekyll-site/contact.md +22 -0
  30. data/example-jekyll-site/digital_art.md +24 -0
  31. data/example-jekyll-site/imprint.md +22 -0
  32. data/example-jekyll-site/index.md +22 -0
  33. data/example-jekyll-site/portfolio.md +22 -0
  34. data/example-jekyll-site/traditional_art.md +24 -0
  35. data/jekyll-navigation.gemspec +26 -0
  36. data/lib/jekyll-navigation.rb +38 -0
  37. data/lib/jekyll-navigation/navigation.rb +44 -0
  38. data/lib/jekyll-navigation/navigation_item.rb +49 -0
  39. data/lib/jekyll-navigation/version.rb +3 -0
  40. data/resources/example.png +0 -0
  41. data/spec/examples/pages.yml +14 -0
  42. data/spec/examples/pages_spec.rb +10 -0
  43. data/spec/jekyll-navigation_spec.rb +193 -0
  44. data/spec/spec_helper.rb +25 -0
  45. data/spec/support/pages.rb +35 -0
  46. metadata +177 -0
@@ -0,0 +1,25 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ RSpec.configure do |config|
8
+ config.treat_symbols_as_metadata_keys_with_true_values = true
9
+ config.run_all_when_everything_filtered = true
10
+ config.filter_run :focus
11
+
12
+ # Run specs in random order to surface order dependencies. If you find an
13
+ # order dependency and want to debug it, you can fix the order by providing
14
+ # the seed, which is printed after each run.
15
+ # --seed 1234
16
+ config.order = 'random'
17
+ end
18
+
19
+ lib = File.expand_path('../../lib', __FILE__)
20
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
21
+ require 'jekyll-navigation'
22
+
23
+ Dir.glob(File.join(File.dirname(__FILE__), 'support', '**', '*.rb')).each do |f|
24
+ require f
25
+ end
@@ -0,0 +1,35 @@
1
+ require 'yaml'
2
+
3
+ module PagesHelper
4
+ def load_examples filename
5
+ YAML.load_file("spec/examples/#{filename}.yml").map do |name, data|
6
+ build_page name, data
7
+ end
8
+ end
9
+
10
+ def build_page name, data
11
+ url = '/' + File.basename(name, File.extname(name)) + '.html'
12
+ page = double('page')
13
+ page.stub(:name).and_return(name)
14
+ page.stub(:url).and_return(url)
15
+ page.stub(:[]).and_return do |key|
16
+ data[key]
17
+ end
18
+ page.stub(:data).and_return(data)
19
+ page
20
+ end
21
+
22
+ def build_current_page page
23
+ data = page.data.dup.merge('url' => page.url)
24
+ current_page = double('current_page')
25
+ current_page.stub(:[]).and_return do |key|
26
+ data[key]
27
+ end
28
+ current_page.stub(:data).and_return(data)
29
+ current_page
30
+ end
31
+ end
32
+
33
+ RSpec.configure do |config|
34
+ config.include(PagesHelper)
35
+ end
metadata ADDED
@@ -0,0 +1,177 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-navigation
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jens Bissinger
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: liquid
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: guard-rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: terminal-notifier-guard
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: jekyll
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ description: Navigations for Jekyll-based sites. Twitter Bootstrap compatible.
95
+ email:
96
+ - mail@jens-bissinger.de
97
+ executables: []
98
+ extensions: []
99
+ extra_rdoc_files: []
100
+ files:
101
+ - .gitignore
102
+ - .rspec
103
+ - Gemfile
104
+ - Guardfile
105
+ - LICENSE.txt
106
+ - README.md
107
+ - Rakefile
108
+ - example-jekyll-site/_config.yml
109
+ - example-jekyll-site/_layouts/default.html
110
+ - example-jekyll-site/_plugins/navigation.rb
111
+ - example-jekyll-site/_site/assets/css/bootstrap.css
112
+ - example-jekyll-site/_site/assets/css/bootstrap.min.css
113
+ - example-jekyll-site/_site/assets/img/glyphicons-halflings-white.png
114
+ - example-jekyll-site/_site/assets/img/glyphicons-halflings.png
115
+ - example-jekyll-site/_site/assets/js/bootstrap.js
116
+ - example-jekyll-site/_site/assets/js/bootstrap.min.js
117
+ - example-jekyll-site/_site/contact.html
118
+ - example-jekyll-site/_site/digital_art.html
119
+ - example-jekyll-site/_site/imprint.html
120
+ - example-jekyll-site/_site/index.html
121
+ - example-jekyll-site/_site/portfolio.html
122
+ - example-jekyll-site/_site/traditional_art.html
123
+ - example-jekyll-site/assets/css/bootstrap.css
124
+ - example-jekyll-site/assets/css/bootstrap.min.css
125
+ - example-jekyll-site/assets/img/glyphicons-halflings-white.png
126
+ - example-jekyll-site/assets/img/glyphicons-halflings.png
127
+ - example-jekyll-site/assets/js/bootstrap.js
128
+ - example-jekyll-site/assets/js/bootstrap.min.js
129
+ - example-jekyll-site/contact.md
130
+ - example-jekyll-site/digital_art.md
131
+ - example-jekyll-site/imprint.md
132
+ - example-jekyll-site/index.md
133
+ - example-jekyll-site/portfolio.md
134
+ - example-jekyll-site/traditional_art.md
135
+ - jekyll-navigation.gemspec
136
+ - lib/jekyll-navigation.rb
137
+ - lib/jekyll-navigation/navigation.rb
138
+ - lib/jekyll-navigation/navigation_item.rb
139
+ - lib/jekyll-navigation/version.rb
140
+ - resources/example.png
141
+ - spec/examples/pages.yml
142
+ - spec/examples/pages_spec.rb
143
+ - spec/jekyll-navigation_spec.rb
144
+ - spec/spec_helper.rb
145
+ - spec/support/pages.rb
146
+ homepage: ''
147
+ licenses: []
148
+ post_install_message:
149
+ rdoc_options: []
150
+ require_paths:
151
+ - lib
152
+ required_ruby_version: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ none: false
160
+ requirements:
161
+ - - ! '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
+ requirements: []
165
+ rubyforge_project:
166
+ rubygems_version: 1.8.23
167
+ signing_key:
168
+ specification_version: 3
169
+ summary: This gem provides [Jekyll](http://github.com/mojombo/jekyll) tags to render
170
+ navigation lists.
171
+ test_files:
172
+ - spec/examples/pages.yml
173
+ - spec/examples/pages_spec.rb
174
+ - spec/jekyll-navigation_spec.rb
175
+ - spec/spec_helper.rb
176
+ - spec/support/pages.rb
177
+ has_rdoc: