├── .coveralls.yml ├── .gitignore ├── .rspec ├── .travis.yml ├── Appraisals ├── Gemfile ├── Gemfile.lock ├── MIT-LICENSE ├── README.md ├── Rakefile ├── app └── helpers │ ├── .gitkeep │ └── nav_link_helper.rb ├── gemfiles ├── rails31.gemfile ├── rails31.gemfile.lock ├── rails32.gemfile ├── rails32.gemfile.lock ├── rails4.gemfile ├── rails4.gemfile.lock ├── rails41.gemfile ├── rails41.gemfile.lock ├── rails411.gemfile └── rails411.gemfile.lock ├── lib ├── nav_lynx.rb └── nav_lynx │ ├── engine.rb │ └── version.rb ├── nav_lynx.gemspec ├── script └── rails └── spec ├── dummy ├── README.rdoc ├── Rakefile ├── app │ ├── assets │ │ ├── javascripts │ │ │ └── application.js │ │ └── stylesheets │ │ │ └── application.css │ ├── controllers │ │ ├── application_controller.rb │ │ ├── dashboard_controller.rb │ │ └── projects_controller.rb │ ├── helpers │ │ └── application_helper.rb │ ├── mailers │ │ └── .gitkeep │ ├── models │ │ └── .gitkeep │ └── views │ │ ├── dashboard │ │ └── show.html.erb │ │ └── layouts │ │ └── application.html.erb ├── config.ru ├── config │ ├── application.rb │ ├── boot.rb │ ├── database.yml │ ├── environment.rb │ ├── environments │ │ ├── development.rb │ │ ├── production.rb │ │ └── test.rb │ ├── initializers │ │ ├── backtrace_silencers.rb │ │ ├── inflections.rb │ │ ├── mime_types.rb │ │ ├── secret_token.rb │ │ ├── session_store.rb │ │ └── wrap_parameters.rb │ ├── locales │ │ └── en.yml │ └── routes.rb ├── db │ └── schema.rb ├── lib │ └── assets │ │ └── .gitkeep ├── log │ └── .gitkeep ├── public │ ├── 404.html │ ├── 422.html │ ├── 500.html │ └── favicon.ico └── script │ └── rails ├── features └── navigation_spec.rb ├── helpers └── nav_link_helper_spec.rb └── spec_helper.rb /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | log/*.log 3 | pkg/ 4 | spec/dummy/db/*.sqlite3 5 | spec/dummy/log/*.log 6 | spec/dummy/tmp/ 7 | spec/dummy/.sass-cache 8 | .rvmrc 9 | .ruby-version 10 | coverage/ 11 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - "1.9.3" 4 | - "2.0.0" 5 | - "2.1.0" 6 | - "2.1.1" 7 | - "2.1.2" 8 | - "2.1.3" 9 | gemfile: 10 | - gemfiles/rails31.gemfile 11 | - gemfiles/rails32.gemfile 12 | - gemfiles/rails4.gemfile 13 | - gemfiles/rails411.gemfile 14 | - gemfiles/rails41.gemfile 15 | -------------------------------------------------------------------------------- /Appraisals: -------------------------------------------------------------------------------- 1 | appraise "rails31" do 2 | gem "rails", "~> 3.1.0" 3 | end 4 | 5 | appraise "rails32" do 6 | gem "rails", "~> 3.2.0" 7 | end 8 | 9 | appraise "rails4" do 10 | gem "rails", "~> 4.0.0" 11 | end 12 | 13 | appraise "rails411" do 14 | gem "rails", "4.1.1" 15 | end 16 | 17 | appraise "rails41" do 18 | gem "rails", "~> 4.1.0" 19 | end 20 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | # Declare your gem's dependencies in nav_lynx.gemspec. 4 | # Bundler will treat runtime dependencies like base dependencies, and 5 | # development dependencies will be added by default to the :development group. 6 | gemspec 7 | 8 | # jquery-rails is used by the dummy application 9 | gem "jquery-rails" 10 | 11 | # Declare any dependencies that are still in development here instead of in 12 | # your gemspec. These might include edge Rails or gems from your path or 13 | # Git. Remember to move these dependencies to your gemspec before releasing 14 | # your gem to rubygems.org. 15 | 16 | # To use debugger 17 | # gem 'debugger' 18 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | nav_lynx (1.1.1) 5 | rails (>= 3.1.0) 6 | 7 | GEM 8 | remote: http://rubygems.org/ 9 | specs: 10 | actionmailer (3.2.13) 11 | actionpack (= 3.2.13) 12 | mail (~> 2.5.3) 13 | actionpack (3.2.13) 14 | activemodel (= 3.2.13) 15 | activesupport (= 3.2.13) 16 | builder (~> 3.0.0) 17 | erubis (~> 2.7.0) 18 | journey (~> 1.0.4) 19 | rack (~> 1.4.5) 20 | rack-cache (~> 1.2) 21 | rack-test (~> 0.6.1) 22 | sprockets (~> 2.2.1) 23 | activemodel (3.2.13) 24 | activesupport (= 3.2.13) 25 | builder (~> 3.0.0) 26 | activerecord (3.2.13) 27 | activemodel (= 3.2.13) 28 | activesupport (= 3.2.13) 29 | arel (~> 3.0.2) 30 | tzinfo (~> 0.3.29) 31 | activeresource (3.2.13) 32 | activemodel (= 3.2.13) 33 | activesupport (= 3.2.13) 34 | activesupport (3.2.13) 35 | i18n (= 0.6.1) 36 | multi_json (~> 1.0) 37 | appraisal (1.0.2) 38 | bundler 39 | rake 40 | thor (>= 0.14.0) 41 | arel (3.0.3) 42 | builder (3.0.4) 43 | capybara (2.2.1) 44 | mime-types (>= 1.16) 45 | nokogiri (>= 1.3.3) 46 | rack (>= 1.0.0) 47 | rack-test (>= 0.5.4) 48 | xpath (~> 2.0) 49 | coveralls (0.7.0) 50 | multi_json (~> 1.3) 51 | rest-client 52 | simplecov (>= 0.7) 53 | term-ansicolor 54 | thor 55 | diff-lcs (1.2.5) 56 | docile (1.1.3) 57 | erubis (2.7.0) 58 | hike (1.2.3) 59 | i18n (0.6.1) 60 | journey (1.0.4) 61 | jquery-rails (3.0.1) 62 | railties (>= 3.0, < 5.0) 63 | thor (>= 0.14, < 2.0) 64 | json (1.8.1) 65 | mail (2.5.4) 66 | mime-types (~> 1.16) 67 | treetop (~> 1.4.8) 68 | mime-types (1.23) 69 | mini_portile (0.6.0) 70 | multi_json (1.10.1) 71 | nokogiri (1.6.3.1) 72 | mini_portile (= 0.6.0) 73 | polyglot (0.3.5) 74 | rack (1.4.5) 75 | rack-cache (1.2) 76 | rack (>= 0.4) 77 | rack-ssl (1.3.4) 78 | rack 79 | rack-test (0.6.2) 80 | rack (>= 1.0) 81 | rails (3.2.13) 82 | actionmailer (= 3.2.13) 83 | actionpack (= 3.2.13) 84 | activerecord (= 3.2.13) 85 | activeresource (= 3.2.13) 86 | activesupport (= 3.2.13) 87 | bundler (~> 1.0) 88 | railties (= 3.2.13) 89 | railties (3.2.13) 90 | actionpack (= 3.2.13) 91 | activesupport (= 3.2.13) 92 | rack-ssl (~> 1.3.2) 93 | rake (>= 0.8.7) 94 | rdoc (~> 3.4) 95 | thor (>= 0.14.6, < 2.0) 96 | rake (10.3.2) 97 | rdoc (3.12.2) 98 | json (~> 1.4) 99 | rest-client (1.6.7) 100 | mime-types (>= 1.16) 101 | rspec (2.14.1) 102 | rspec-core (~> 2.14.0) 103 | rspec-expectations (~> 2.14.0) 104 | rspec-mocks (~> 2.14.0) 105 | rspec-core (2.14.8) 106 | rspec-expectations (2.14.5) 107 | diff-lcs (>= 1.1.3, < 2.0) 108 | rspec-html-matchers (0.5.0) 109 | nokogiri (~> 1) 110 | rspec (~> 2, >= 2.11.0) 111 | rspec-mocks (2.14.6) 112 | rspec-rails (2.14.2) 113 | actionpack (>= 3.0) 114 | activemodel (>= 3.0) 115 | activesupport (>= 3.0) 116 | railties (>= 3.0) 117 | rspec-core (~> 2.14.0) 118 | rspec-expectations (~> 2.14.0) 119 | rspec-mocks (~> 2.14.0) 120 | simplecov (0.8.2) 121 | docile (~> 1.1.0) 122 | multi_json 123 | simplecov-html (~> 0.8.0) 124 | simplecov-html (0.8.0) 125 | sprockets (2.2.2) 126 | hike (~> 1.2) 127 | multi_json (~> 1.0) 128 | rack (~> 1.0) 129 | tilt (~> 1.1, != 1.3.0) 130 | sqlite3 (1.3.7) 131 | term-ansicolor (1.3.0) 132 | tins (~> 1.0) 133 | thor (0.19.1) 134 | tilt (1.4.1) 135 | tins (1.0.0) 136 | treetop (1.4.15) 137 | polyglot 138 | polyglot (>= 0.3.1) 139 | tzinfo (0.3.40) 140 | xpath (2.0.0) 141 | nokogiri (~> 1.3) 142 | 143 | PLATFORMS 144 | ruby 145 | 146 | DEPENDENCIES 147 | appraisal (~> 1.0.2) 148 | capybara (~> 2.2.0) 149 | coveralls 150 | jquery-rails 151 | nav_lynx! 152 | rake 153 | rspec-html-matchers (< 0.6.0) 154 | rspec-rails (~> 2.14.0) 155 | sqlite3 156 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Dan Tello (Viget) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NavLYNX 2 | 3 | [![Code Climate](https://codeclimate.com/github/vigetlabs/nav_lynx.png)](https://codeclimate.com/github/vigetlabs/nav_lynx) [![Build Status](https://travis-ci.org/vigetlabs/nav_lynx.png?branch=master)](https://travis-ci.org/vigetlabs/nav_lynx) [![Coverage Status](https://coveralls.io/repos/vigetlabs/nav_lynx/badge.png?branch=master)](https://coveralls.io/r/vigetlabs/nav_lynx?branch=master) [![Gem Version](https://badge.fury.io/rb/nav_lynx.png)](http://badge.fury.io/rb/nav_lynx) 4 | 5 | NavLYNX provides a `nav_link_to` helper that works just like the standard Rails `link_to` helper, but adds a `selected` class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link. 6 | 7 | ```erb 8 | <%= nav_link_to 'My Page', my_path %> 9 | ``` 10 | 11 | When `my_path` is the same as the current page url, this outputs: 12 | 13 | ```html 14 | My Page 15 | ``` 16 | Currenty NavLYNX only supports `_path` URL helpers, full `_url`'s will not match the current link correctly. 17 | 18 | ### Usage with blocks: 19 | 20 | Same usage as `link_to`: 21 | 22 | ```erb 23 | <%= nav_link_to 'http://example.com/page' do %> 24 | My Page 25 | <% end %> 26 | ``` 27 | ### Usage with options 28 | 29 | ```erb 30 | <%= nav_link_to my_path, html_options, nav_lynx_options %> 31 | ``` 32 | 33 | ## Install 34 | 35 | 1. Add this to your Gemfile: 36 |
gem 'nav_lynx'
37 | 2. `bundle install` 38 | 3. Use `nav_link_to` helper in your views. 39 | 40 | ## Config option 41 | 42 | There is one config option `selected_class`. If you want a different class then "selected" for selected nav items globally you can use this option to change that. You can set this inside your configuration in `config/application.rb` of your Rails application like so: 43 | 44 | ```rb 45 | module MyApplication 46 | class Application < Rails::Application 47 | # ... 48 | 49 | config.nav_lynx.selected_class = 'current' 50 | end 51 | end 52 | ``` 53 | 54 | ## Inline options 55 | ### :selected_class 56 | Overrides the default class of ‘selected’ as the class to be added to your selected nav on a per-link basis. 57 | 58 | 59 | ```erb 60 | <%= nav_link_to 'Page', my_path, {}, {:selected_class => 'customClassName'} %> 61 | ``` 62 | *Default Value:* `selected` 63 | 64 | ### :ignore_params 65 | Set this to true if you want the helper to ignore query strings in the url when comparing. The urls `http://example.com/` and `http://example.com/?foo=bar` will be treated as equal. 66 | 67 | ```erb 68 | <%= nav_link_to 'Page', my_path, {}, {:ignore_params => 'true'} %> 69 | ``` 70 | *Default Value:* `false` 71 | 72 | ### :url_segment 73 | 74 | Instead of comparing full urls, you can check only segments of the urls. In the path `/news/article`, `news` is segment 1, `article` is segment 2. This is especially useful for category navigation. Assign an index identifying the url segment you wish to match. For example, if a page’s or link’s url is `example.com/news/story`, and you specify `:url_segment => 1`, the helper will look to match `/news/*`. 75 | 76 | ```erb 77 | <%= nav_link_to 'Page', my_path, {}, {:url_segment => 1} %> 78 | ``` 79 | *Default Value:* `false` 80 | 81 | ### :controller_segment 82 | 83 | Like `:url_segment`, but compares controllers instead. For example, if your controller is `members/pages`, and you specify `:controller_segment => 1`, the helper will treat any page with `members` as the first segment of the controller as a match. 84 | 85 | ```erb 86 | <%= nav_link_to 'Page', my_path, {}, {:controller_segment => 1} %> 87 | ``` 88 | *Default Value:* `false` 89 | 90 | ### :wrapper 91 | 92 | Often times you don’t want your `selected` class directly on the anchor tag. You can wrap your anchor tag in another element with `:wrapper => 'li'` (or any other html element). The `selected` class will be added to this wrapper instead of the anchor. Any `html_options` will still be added directly to the anchor tag. 93 | 94 | ```erb 95 | <%= nav_link_to 'Page', my_path, {}, {:wrapper => 'li'} %> 96 | ``` 97 | 98 | *Default Value:* `false` 99 | 100 | ### :wrapper_class 101 | If you want to specify additional classes for your wrapper (whether it is selected or not), you can add them with `:wrapper_class => 'class-name class-name-2'`. 102 | 103 | ```erb 104 | <%= nav_link_to 'Page', my_path, {}, {:wrapper_class => 'nav-item'} %> 105 | ``` 106 | *Default Value:* `false` 107 | 108 | ## Contributing to NavLYNX 109 | 110 | * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet. 111 | * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it. 112 | * Fork the project. 113 | * Start a feature/bugfix branch. 114 | * Commit and push until you are happy with your contribution. 115 | * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. 116 | * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. 117 | 118 | ## Copyright 119 | Copyright (c) 2014 Viget. See MIT_LICENSE for further details. 120 | Born on Aug 8, 2012 in this [blog post](http://viget.com/extend/rails-selected-nav-link-helper). 121 | 122 | *** 123 | 124 | 125 | Code At Viget 126 | 127 | 128 | Visit [code.viget.com](http://code.viget.com) to see more projects from [Viget.](https://viget.com) 129 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | begin 3 | require 'bundler/setup' 4 | require 'appraisal' 5 | rescue LoadError 6 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 7 | end 8 | 9 | APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__) 10 | load 'rails/tasks/engine.rake' 11 | 12 | Bundler::GemHelper.install_tasks 13 | 14 | Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f } 15 | 16 | 17 | require 'rspec/core' 18 | require 'rspec/core/rake_task' 19 | 20 | desc "Run all specs in spec directory (excluding plugin specs)" 21 | RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare') 22 | 23 | task :default => :spec 24 | -------------------------------------------------------------------------------- /app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vigetlabs/nav_lynx/8afb3259e6eb7505311aa18ef6713f0be34ab656/app/helpers/.gitkeep -------------------------------------------------------------------------------- /app/helpers/nav_link_helper.rb: -------------------------------------------------------------------------------- 1 | module NavLinkHelper 2 | 3 | def nav_link_to(*args, &block) 4 | title = block_given? ? capture(&block) : args.shift 5 | url_options = args[0] 6 | html_options = args[1] || {} 7 | options = args[2] || {} 8 | 9 | LinkGenerator.new(request, title, url_options, controller,html_options, options).to_html 10 | end 11 | 12 | class LinkGenerator 13 | include ActionView::Helpers::UrlHelper 14 | include Rails.application.routes.url_helpers 15 | 16 | attr_reader :controller 17 | 18 | def initialize(request, title, url_options, controller, html_options = {}, options = {}) 19 | @request = request 20 | @title = title 21 | @url_options = url_options 22 | @html_options = html_options 23 | @options = options 24 | @controller = controller 25 | end 26 | 27 | def to_html 28 | html = link 29 | 30 | if @options[:wrapper] 31 | html = content_tag(@options[:wrapper], html, :class => wrapper_classes) 32 | end 33 | 34 | html.html_safe 35 | end 36 | 37 | private 38 | 39 | def link 40 | link_to(@title, @url_options, html_options) 41 | end 42 | 43 | def html_options 44 | selected? ? @html_options.merge(:class => link_classes) : @html_options 45 | end 46 | 47 | def selected? 48 | paths_match? || segments_match? 49 | end 50 | 51 | def paths_match? 52 | current_path == link_path 53 | end 54 | 55 | def current_path 56 | comparable_path_for(@request.fullpath) 57 | end 58 | 59 | def link_path 60 | path = url_for(@url_options) 61 | comparable_path_for(path) 62 | end 63 | 64 | def comparable_path_for(path) 65 | if @options[:ignore_params] 66 | path.gsub(/\?.*/, '') 67 | else 68 | path 69 | end 70 | end 71 | 72 | def segments_match? 73 | path_segment && path_segment == current_segment 74 | end 75 | 76 | def path_segment 77 | segment_for(path_controller, current_path) 78 | end 79 | 80 | def segment_for(controller, path) 81 | if @options[:controller_segment] 82 | controller.split('/')[segment_position] 83 | elsif @options[:url_segment] 84 | path.split('/')[segment_position] 85 | end 86 | end 87 | 88 | def path_controller 89 | if @url_options.is_a?(Hash) && @url_options[:controller] 90 | @url_options[:controller] 91 | else 92 | controller_for(url_for(@url_options)) 93 | end 94 | end 95 | 96 | def segment_position 97 | if @options[:controller_segment] 98 | @options[:controller_segment] - 1 99 | elsif @options[:url_segment] 100 | @options[:url_segment] 101 | end 102 | end 103 | 104 | def controller_for(path) 105 | Rails.application.routes.recognize_path(path)[:controller] 106 | rescue ActionController::RoutingError 107 | nil 108 | end 109 | 110 | def current_segment 111 | segment_for(current_controller, link_path) 112 | end 113 | 114 | def current_controller 115 | controller_for(@request.path) 116 | end 117 | 118 | def link_classes 119 | if @html_options[:class] 120 | @html_options[:class] + " #{selected_class}" 121 | elsif !@options[:wrapper] 122 | selected_class 123 | end 124 | end 125 | 126 | def selected_class 127 | @options[:selected_class] || NavLYNX.selected_class 128 | end 129 | 130 | def wrapper_classes 131 | if selected? 132 | return selected_class if @options[:wrapper_class].blank? 133 | "#{selected_class} #{@options[:wrapper_class]}" 134 | else 135 | @options[:wrapper_class] 136 | end 137 | end 138 | end 139 | 140 | end 141 | -------------------------------------------------------------------------------- /gemfiles/rails31.gemfile: -------------------------------------------------------------------------------- 1 | # This file was generated by Appraisal 2 | 3 | source "http://rubygems.org" 4 | 5 | gem "jquery-rails" 6 | gem "rails", "~> 3.1.0" 7 | 8 | gemspec :path => "../" 9 | -------------------------------------------------------------------------------- /gemfiles/rails31.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: ../ 3 | specs: 4 | nav_lynx (1.1.1) 5 | rails (>= 3.1.0) 6 | 7 | GEM 8 | remote: http://rubygems.org/ 9 | specs: 10 | actionmailer (3.1.0) 11 | actionpack (= 3.1.0) 12 | mail (~> 2.3.0) 13 | actionpack (3.1.0) 14 | activemodel (= 3.1.0) 15 | activesupport (= 3.1.0) 16 | builder (~> 3.0.0) 17 | erubis (~> 2.7.0) 18 | i18n (~> 0.6) 19 | rack (~> 1.3.2) 20 | rack-cache (~> 1.0.3) 21 | rack-mount (~> 0.8.2) 22 | rack-test (~> 0.6.1) 23 | sprockets (~> 2.0.0) 24 | activemodel (3.1.0) 25 | activesupport (= 3.1.0) 26 | bcrypt-ruby (~> 3.0.0) 27 | builder (~> 3.0.0) 28 | i18n (~> 0.6) 29 | activerecord (3.1.0) 30 | activemodel (= 3.1.0) 31 | activesupport (= 3.1.0) 32 | arel (~> 2.2.1) 33 | tzinfo (~> 0.3.29) 34 | activeresource (3.1.0) 35 | activemodel (= 3.1.0) 36 | activesupport (= 3.1.0) 37 | activesupport (3.1.0) 38 | multi_json (~> 1.0) 39 | appraisal (1.0.2) 40 | bundler 41 | rake 42 | thor (>= 0.14.0) 43 | arel (2.2.3) 44 | bcrypt-ruby (3.0.1) 45 | builder (3.0.4) 46 | capybara (2.2.1) 47 | mime-types (>= 1.16) 48 | nokogiri (>= 1.3.3) 49 | rack (>= 1.0.0) 50 | rack-test (>= 0.5.4) 51 | xpath (~> 2.0) 52 | coveralls (0.7.0) 53 | multi_json (~> 1.3) 54 | rest-client 55 | simplecov (>= 0.7) 56 | term-ansicolor 57 | thor 58 | diff-lcs (1.2.5) 59 | docile (1.1.5) 60 | erubis (2.7.0) 61 | hike (1.2.3) 62 | i18n (0.6.11) 63 | jquery-rails (3.1.1) 64 | railties (>= 3.0, < 5.0) 65 | thor (>= 0.14, < 2.0) 66 | json (1.8.1) 67 | mail (2.3.3) 68 | i18n (>= 0.4.0) 69 | mime-types (~> 1.16) 70 | treetop (~> 1.4.8) 71 | mime-types (1.25.1) 72 | mini_portile (0.6.0) 73 | multi_json (1.10.1) 74 | nokogiri (1.6.3.1) 75 | mini_portile (= 0.6.0) 76 | polyglot (0.3.5) 77 | rack (1.3.10) 78 | rack-cache (1.0.3) 79 | rack (>= 0.4) 80 | rack-mount (0.8.3) 81 | rack (>= 1.0.0) 82 | rack-ssl (1.3.4) 83 | rack 84 | rack-test (0.6.2) 85 | rack (>= 1.0) 86 | rails (3.1.0) 87 | actionmailer (= 3.1.0) 88 | actionpack (= 3.1.0) 89 | activerecord (= 3.1.0) 90 | activeresource (= 3.1.0) 91 | activesupport (= 3.1.0) 92 | bundler (~> 1.0) 93 | railties (= 3.1.0) 94 | railties (3.1.0) 95 | actionpack (= 3.1.0) 96 | activesupport (= 3.1.0) 97 | rack-ssl (~> 1.3.2) 98 | rake (>= 0.8.7) 99 | rdoc (~> 3.4) 100 | thor (~> 0.14.6) 101 | rake (10.3.2) 102 | rdoc (3.12.2) 103 | json (~> 1.4) 104 | rest-client (1.6.7) 105 | mime-types (>= 1.16) 106 | rspec (2.14.1) 107 | rspec-core (~> 2.14.0) 108 | rspec-expectations (~> 2.14.0) 109 | rspec-mocks (~> 2.14.0) 110 | rspec-core (2.14.8) 111 | rspec-expectations (2.14.5) 112 | diff-lcs (>= 1.1.3, < 2.0) 113 | rspec-html-matchers (0.5.0) 114 | nokogiri (~> 1) 115 | rspec (~> 2, >= 2.11.0) 116 | rspec-mocks (2.14.6) 117 | rspec-rails (2.14.2) 118 | actionpack (>= 3.0) 119 | activemodel (>= 3.0) 120 | activesupport (>= 3.0) 121 | railties (>= 3.0) 122 | rspec-core (~> 2.14.0) 123 | rspec-expectations (~> 2.14.0) 124 | rspec-mocks (~> 2.14.0) 125 | simplecov (0.9.0) 126 | docile (~> 1.1.0) 127 | multi_json 128 | simplecov-html (~> 0.8.0) 129 | simplecov-html (0.8.0) 130 | sprockets (2.0.4) 131 | hike (~> 1.2) 132 | rack (~> 1.0) 133 | tilt (~> 1.1, != 1.3.0) 134 | sqlite3 (1.3.9) 135 | term-ansicolor (1.3.0) 136 | tins (~> 1.0) 137 | thor (0.14.6) 138 | tilt (1.4.1) 139 | tins (1.0.0) 140 | treetop (1.4.15) 141 | polyglot 142 | polyglot (>= 0.3.1) 143 | tzinfo (0.3.40) 144 | xpath (2.0.0) 145 | nokogiri (~> 1.3) 146 | 147 | PLATFORMS 148 | ruby 149 | 150 | DEPENDENCIES 151 | appraisal (~> 1.0.2) 152 | capybara (~> 2.2.0) 153 | coveralls 154 | jquery-rails 155 | nav_lynx! 156 | rails (~> 3.1.0) 157 | rake 158 | rspec-html-matchers (< 0.6.0) 159 | rspec-rails (~> 2.14.0) 160 | sqlite3 161 | -------------------------------------------------------------------------------- /gemfiles/rails32.gemfile: -------------------------------------------------------------------------------- 1 | # This file was generated by Appraisal 2 | 3 | source "http://rubygems.org" 4 | 5 | gem "jquery-rails" 6 | gem "rails", "~> 3.2.0" 7 | 8 | gemspec :path => "../" 9 | -------------------------------------------------------------------------------- /gemfiles/rails32.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: ../ 3 | specs: 4 | nav_lynx (1.1.1) 5 | rails (>= 3.1.0) 6 | 7 | GEM 8 | remote: http://rubygems.org/ 9 | specs: 10 | actionmailer (3.2.19) 11 | actionpack (= 3.2.19) 12 | mail (~> 2.5.4) 13 | actionpack (3.2.19) 14 | activemodel (= 3.2.19) 15 | activesupport (= 3.2.19) 16 | builder (~> 3.0.0) 17 | erubis (~> 2.7.0) 18 | journey (~> 1.0.4) 19 | rack (~> 1.4.5) 20 | rack-cache (~> 1.2) 21 | rack-test (~> 0.6.1) 22 | sprockets (~> 2.2.1) 23 | activemodel (3.2.19) 24 | activesupport (= 3.2.19) 25 | builder (~> 3.0.0) 26 | activerecord (3.2.19) 27 | activemodel (= 3.2.19) 28 | activesupport (= 3.2.19) 29 | arel (~> 3.0.2) 30 | tzinfo (~> 0.3.29) 31 | activeresource (3.2.19) 32 | activemodel (= 3.2.19) 33 | activesupport (= 3.2.19) 34 | activesupport (3.2.19) 35 | i18n (~> 0.6, >= 0.6.4) 36 | multi_json (~> 1.0) 37 | appraisal (1.0.2) 38 | bundler 39 | rake 40 | thor (>= 0.14.0) 41 | arel (3.0.3) 42 | builder (3.0.4) 43 | capybara (2.2.1) 44 | mime-types (>= 1.16) 45 | nokogiri (>= 1.3.3) 46 | rack (>= 1.0.0) 47 | rack-test (>= 0.5.4) 48 | xpath (~> 2.0) 49 | coveralls (0.7.0) 50 | multi_json (~> 1.3) 51 | rest-client 52 | simplecov (>= 0.7) 53 | term-ansicolor 54 | thor 55 | diff-lcs (1.2.5) 56 | docile (1.1.5) 57 | erubis (2.7.0) 58 | hike (1.2.3) 59 | i18n (0.6.11) 60 | journey (1.0.4) 61 | jquery-rails (3.1.1) 62 | railties (>= 3.0, < 5.0) 63 | thor (>= 0.14, < 2.0) 64 | json (1.8.1) 65 | mail (2.5.4) 66 | mime-types (~> 1.16) 67 | treetop (~> 1.4.8) 68 | mime-types (1.25.1) 69 | mini_portile (0.6.0) 70 | multi_json (1.10.1) 71 | nokogiri (1.6.3.1) 72 | mini_portile (= 0.6.0) 73 | polyglot (0.3.5) 74 | rack (1.4.5) 75 | rack-cache (1.2) 76 | rack (>= 0.4) 77 | rack-ssl (1.3.4) 78 | rack 79 | rack-test (0.6.2) 80 | rack (>= 1.0) 81 | rails (3.2.19) 82 | actionmailer (= 3.2.19) 83 | actionpack (= 3.2.19) 84 | activerecord (= 3.2.19) 85 | activeresource (= 3.2.19) 86 | activesupport (= 3.2.19) 87 | bundler (~> 1.0) 88 | railties (= 3.2.19) 89 | railties (3.2.19) 90 | actionpack (= 3.2.19) 91 | activesupport (= 3.2.19) 92 | rack-ssl (~> 1.3.2) 93 | rake (>= 0.8.7) 94 | rdoc (~> 3.4) 95 | thor (>= 0.14.6, < 2.0) 96 | rake (10.3.2) 97 | rdoc (3.12.2) 98 | json (~> 1.4) 99 | rest-client (1.6.7) 100 | mime-types (>= 1.16) 101 | rspec (2.14.1) 102 | rspec-core (~> 2.14.0) 103 | rspec-expectations (~> 2.14.0) 104 | rspec-mocks (~> 2.14.0) 105 | rspec-core (2.14.8) 106 | rspec-expectations (2.14.5) 107 | diff-lcs (>= 1.1.3, < 2.0) 108 | rspec-html-matchers (0.5.0) 109 | nokogiri (~> 1) 110 | rspec (~> 2, >= 2.11.0) 111 | rspec-mocks (2.14.6) 112 | rspec-rails (2.14.2) 113 | actionpack (>= 3.0) 114 | activemodel (>= 3.0) 115 | activesupport (>= 3.0) 116 | railties (>= 3.0) 117 | rspec-core (~> 2.14.0) 118 | rspec-expectations (~> 2.14.0) 119 | rspec-mocks (~> 2.14.0) 120 | simplecov (0.9.0) 121 | docile (~> 1.1.0) 122 | multi_json 123 | simplecov-html (~> 0.8.0) 124 | simplecov-html (0.8.0) 125 | sprockets (2.2.2) 126 | hike (~> 1.2) 127 | multi_json (~> 1.0) 128 | rack (~> 1.0) 129 | tilt (~> 1.1, != 1.3.0) 130 | sqlite3 (1.3.9) 131 | term-ansicolor (1.3.0) 132 | tins (~> 1.0) 133 | thor (0.19.1) 134 | tilt (1.4.1) 135 | tins (1.0.0) 136 | treetop (1.4.15) 137 | polyglot 138 | polyglot (>= 0.3.1) 139 | tzinfo (0.3.40) 140 | xpath (2.0.0) 141 | nokogiri (~> 1.3) 142 | 143 | PLATFORMS 144 | ruby 145 | 146 | DEPENDENCIES 147 | appraisal (~> 1.0.2) 148 | capybara (~> 2.2.0) 149 | coveralls 150 | jquery-rails 151 | nav_lynx! 152 | rails (~> 3.2.0) 153 | rake 154 | rspec-html-matchers (< 0.6.0) 155 | rspec-rails (~> 2.14.0) 156 | sqlite3 157 | -------------------------------------------------------------------------------- /gemfiles/rails4.gemfile: -------------------------------------------------------------------------------- 1 | # This file was generated by Appraisal 2 | 3 | source "http://rubygems.org" 4 | 5 | gem "jquery-rails" 6 | gem "rails", "~> 4.0.0" 7 | 8 | gemspec :path => "../" 9 | -------------------------------------------------------------------------------- /gemfiles/rails4.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: ../ 3 | specs: 4 | nav_lynx (1.1.1) 5 | rails (>= 3.1.0) 6 | 7 | GEM 8 | remote: http://rubygems.org/ 9 | specs: 10 | actionmailer (4.0.2) 11 | actionpack (= 4.0.2) 12 | mail (~> 2.5.4) 13 | actionpack (4.0.2) 14 | activesupport (= 4.0.2) 15 | builder (~> 3.1.0) 16 | erubis (~> 2.7.0) 17 | rack (~> 1.5.2) 18 | rack-test (~> 0.6.2) 19 | activemodel (4.0.2) 20 | activesupport (= 4.0.2) 21 | builder (~> 3.1.0) 22 | activerecord (4.0.2) 23 | activemodel (= 4.0.2) 24 | activerecord-deprecated_finders (~> 1.0.2) 25 | activesupport (= 4.0.2) 26 | arel (~> 4.0.0) 27 | activerecord-deprecated_finders (1.0.3) 28 | activesupport (4.0.2) 29 | i18n (~> 0.6, >= 0.6.4) 30 | minitest (~> 4.2) 31 | multi_json (~> 1.3) 32 | thread_safe (~> 0.1) 33 | tzinfo (~> 0.3.37) 34 | appraisal (1.0.2) 35 | bundler 36 | rake 37 | thor (>= 0.14.0) 38 | arel (4.0.1) 39 | builder (3.1.4) 40 | capybara (2.2.1) 41 | mime-types (>= 1.16) 42 | nokogiri (>= 1.3.3) 43 | rack (>= 1.0.0) 44 | rack-test (>= 0.5.4) 45 | xpath (~> 2.0) 46 | coveralls (0.7.0) 47 | multi_json (~> 1.3) 48 | rest-client 49 | simplecov (>= 0.7) 50 | term-ansicolor 51 | thor 52 | diff-lcs (1.2.5) 53 | docile (1.1.5) 54 | erubis (2.7.0) 55 | hike (1.2.3) 56 | i18n (0.6.11) 57 | jquery-rails (3.1.1) 58 | railties (>= 3.0, < 5.0) 59 | thor (>= 0.14, < 2.0) 60 | mail (2.5.4) 61 | mime-types (~> 1.16) 62 | treetop (~> 1.4.8) 63 | mime-types (1.25.1) 64 | mini_portile (0.6.0) 65 | minitest (4.7.5) 66 | multi_json (1.10.1) 67 | nokogiri (1.6.3.1) 68 | mini_portile (= 0.6.0) 69 | polyglot (0.3.5) 70 | rack (1.5.2) 71 | rack-test (0.6.2) 72 | rack (>= 1.0) 73 | rails (4.0.2) 74 | actionmailer (= 4.0.2) 75 | actionpack (= 4.0.2) 76 | activerecord (= 4.0.2) 77 | activesupport (= 4.0.2) 78 | bundler (>= 1.3.0, < 2.0) 79 | railties (= 4.0.2) 80 | sprockets-rails (~> 2.0.0) 81 | railties (4.0.2) 82 | actionpack (= 4.0.2) 83 | activesupport (= 4.0.2) 84 | rake (>= 0.8.7) 85 | thor (>= 0.18.1, < 2.0) 86 | rake (10.3.2) 87 | rest-client (1.6.7) 88 | mime-types (>= 1.16) 89 | rspec (2.14.1) 90 | rspec-core (~> 2.14.0) 91 | rspec-expectations (~> 2.14.0) 92 | rspec-mocks (~> 2.14.0) 93 | rspec-core (2.14.8) 94 | rspec-expectations (2.14.5) 95 | diff-lcs (>= 1.1.3, < 2.0) 96 | rspec-html-matchers (0.5.0) 97 | nokogiri (~> 1) 98 | rspec (~> 2, >= 2.11.0) 99 | rspec-mocks (2.14.6) 100 | rspec-rails (2.14.2) 101 | actionpack (>= 3.0) 102 | activemodel (>= 3.0) 103 | activesupport (>= 3.0) 104 | railties (>= 3.0) 105 | rspec-core (~> 2.14.0) 106 | rspec-expectations (~> 2.14.0) 107 | rspec-mocks (~> 2.14.0) 108 | simplecov (0.9.0) 109 | docile (~> 1.1.0) 110 | multi_json 111 | simplecov-html (~> 0.8.0) 112 | simplecov-html (0.8.0) 113 | sprockets (2.11.0) 114 | hike (~> 1.2) 115 | multi_json (~> 1.0) 116 | rack (~> 1.0) 117 | tilt (~> 1.1, != 1.3.0) 118 | sprockets-rails (2.0.1) 119 | actionpack (>= 3.0) 120 | activesupport (>= 3.0) 121 | sprockets (~> 2.8) 122 | sqlite3 (1.3.9) 123 | term-ansicolor (1.3.0) 124 | tins (~> 1.0) 125 | thor (0.19.1) 126 | thread_safe (0.3.4) 127 | tilt (1.4.1) 128 | tins (1.0.0) 129 | treetop (1.4.15) 130 | polyglot 131 | polyglot (>= 0.3.1) 132 | tzinfo (0.3.40) 133 | xpath (2.0.0) 134 | nokogiri (~> 1.3) 135 | 136 | PLATFORMS 137 | ruby 138 | 139 | DEPENDENCIES 140 | appraisal (~> 1.0.2) 141 | capybara (~> 2.2.0) 142 | coveralls 143 | jquery-rails 144 | nav_lynx! 145 | rails (~> 4.0.0) 146 | rake 147 | rspec-html-matchers (< 0.6.0) 148 | rspec-rails (~> 2.14.0) 149 | sqlite3 150 | -------------------------------------------------------------------------------- /gemfiles/rails41.gemfile: -------------------------------------------------------------------------------- 1 | # This file was generated by Appraisal 2 | 3 | source "http://rubygems.org" 4 | 5 | gem "jquery-rails" 6 | gem "rails", "~> 4.1.0" 7 | 8 | gemspec :path => "../" 9 | -------------------------------------------------------------------------------- /gemfiles/rails41.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: ../ 3 | specs: 4 | nav_lynx (1.1.1) 5 | rails (>= 3.1.0) 6 | 7 | GEM 8 | remote: http://rubygems.org/ 9 | specs: 10 | actionmailer (4.1.4) 11 | actionpack (= 4.1.4) 12 | actionview (= 4.1.4) 13 | mail (~> 2.5.4) 14 | actionpack (4.1.4) 15 | actionview (= 4.1.4) 16 | activesupport (= 4.1.4) 17 | rack (~> 1.5.2) 18 | rack-test (~> 0.6.2) 19 | actionview (4.1.4) 20 | activesupport (= 4.1.4) 21 | builder (~> 3.1) 22 | erubis (~> 2.7.0) 23 | activemodel (4.1.4) 24 | activesupport (= 4.1.4) 25 | builder (~> 3.1) 26 | activerecord (4.1.4) 27 | activemodel (= 4.1.4) 28 | activesupport (= 4.1.4) 29 | arel (~> 5.0.0) 30 | activesupport (4.1.4) 31 | i18n (~> 0.6, >= 0.6.9) 32 | json (~> 1.7, >= 1.7.7) 33 | minitest (~> 5.1) 34 | thread_safe (~> 0.1) 35 | tzinfo (~> 1.1) 36 | appraisal (1.0.2) 37 | bundler 38 | rake 39 | thor (>= 0.14.0) 40 | arel (5.0.1.20140414130214) 41 | builder (3.2.2) 42 | capybara (2.2.1) 43 | mime-types (>= 1.16) 44 | nokogiri (>= 1.3.3) 45 | rack (>= 1.0.0) 46 | rack-test (>= 0.5.4) 47 | xpath (~> 2.0) 48 | coveralls (0.7.0) 49 | multi_json (~> 1.3) 50 | rest-client 51 | simplecov (>= 0.7) 52 | term-ansicolor 53 | thor 54 | diff-lcs (1.2.5) 55 | docile (1.1.5) 56 | erubis (2.7.0) 57 | hike (1.2.3) 58 | i18n (0.6.11) 59 | jquery-rails (3.1.1) 60 | railties (>= 3.0, < 5.0) 61 | thor (>= 0.14, < 2.0) 62 | json (1.8.1) 63 | mail (2.5.4) 64 | mime-types (~> 1.16) 65 | treetop (~> 1.4.8) 66 | mime-types (1.25.1) 67 | mini_portile (0.6.0) 68 | minitest (5.4.0) 69 | multi_json (1.10.1) 70 | nokogiri (1.6.3.1) 71 | mini_portile (= 0.6.0) 72 | polyglot (0.3.5) 73 | rack (1.5.2) 74 | rack-test (0.6.2) 75 | rack (>= 1.0) 76 | rails (4.1.4) 77 | actionmailer (= 4.1.4) 78 | actionpack (= 4.1.4) 79 | actionview (= 4.1.4) 80 | activemodel (= 4.1.4) 81 | activerecord (= 4.1.4) 82 | activesupport (= 4.1.4) 83 | bundler (>= 1.3.0, < 2.0) 84 | railties (= 4.1.4) 85 | sprockets-rails (~> 2.0) 86 | railties (4.1.4) 87 | actionpack (= 4.1.4) 88 | activesupport (= 4.1.4) 89 | rake (>= 0.8.7) 90 | thor (>= 0.18.1, < 2.0) 91 | rake (10.3.2) 92 | rest-client (1.6.7) 93 | mime-types (>= 1.16) 94 | rspec (2.14.1) 95 | rspec-core (~> 2.14.0) 96 | rspec-expectations (~> 2.14.0) 97 | rspec-mocks (~> 2.14.0) 98 | rspec-core (2.14.8) 99 | rspec-expectations (2.14.5) 100 | diff-lcs (>= 1.1.3, < 2.0) 101 | rspec-html-matchers (0.5.0) 102 | nokogiri (~> 1) 103 | rspec (~> 2, >= 2.11.0) 104 | rspec-mocks (2.14.6) 105 | rspec-rails (2.14.2) 106 | actionpack (>= 3.0) 107 | activemodel (>= 3.0) 108 | activesupport (>= 3.0) 109 | railties (>= 3.0) 110 | rspec-core (~> 2.14.0) 111 | rspec-expectations (~> 2.14.0) 112 | rspec-mocks (~> 2.14.0) 113 | simplecov (0.9.0) 114 | docile (~> 1.1.0) 115 | multi_json 116 | simplecov-html (~> 0.8.0) 117 | simplecov-html (0.8.0) 118 | sprockets (2.11.0) 119 | hike (~> 1.2) 120 | multi_json (~> 1.0) 121 | rack (~> 1.0) 122 | tilt (~> 1.1, != 1.3.0) 123 | sprockets-rails (2.1.3) 124 | actionpack (>= 3.0) 125 | activesupport (>= 3.0) 126 | sprockets (~> 2.8) 127 | sqlite3 (1.3.9) 128 | term-ansicolor (1.3.0) 129 | tins (~> 1.0) 130 | thor (0.19.1) 131 | thread_safe (0.3.4) 132 | tilt (1.4.1) 133 | tins (1.0.0) 134 | treetop (1.4.15) 135 | polyglot 136 | polyglot (>= 0.3.1) 137 | tzinfo (1.2.1) 138 | thread_safe (~> 0.1) 139 | xpath (2.0.0) 140 | nokogiri (~> 1.3) 141 | 142 | PLATFORMS 143 | ruby 144 | 145 | DEPENDENCIES 146 | appraisal (~> 1.0.2) 147 | capybara (~> 2.2.0) 148 | coveralls 149 | jquery-rails 150 | nav_lynx! 151 | rails (~> 4.1.0) 152 | rake 153 | rspec-html-matchers (< 0.6.0) 154 | rspec-rails (~> 2.14.0) 155 | sqlite3 156 | -------------------------------------------------------------------------------- /gemfiles/rails411.gemfile: -------------------------------------------------------------------------------- 1 | # This file was generated by Appraisal 2 | 3 | source "http://rubygems.org" 4 | 5 | gem "jquery-rails" 6 | gem "rails", "4.1.1" 7 | 8 | gemspec :path => "../" 9 | -------------------------------------------------------------------------------- /gemfiles/rails411.gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: ../ 3 | specs: 4 | nav_lynx (1.1.1) 5 | rails (>= 3.1.0) 6 | 7 | GEM 8 | remote: http://rubygems.org/ 9 | specs: 10 | actionmailer (4.1.1) 11 | actionpack (= 4.1.1) 12 | actionview (= 4.1.1) 13 | mail (~> 2.5.4) 14 | actionpack (4.1.1) 15 | actionview (= 4.1.1) 16 | activesupport (= 4.1.1) 17 | rack (~> 1.5.2) 18 | rack-test (~> 0.6.2) 19 | actionview (4.1.1) 20 | activesupport (= 4.1.1) 21 | builder (~> 3.1) 22 | erubis (~> 2.7.0) 23 | activemodel (4.1.1) 24 | activesupport (= 4.1.1) 25 | builder (~> 3.1) 26 | activerecord (4.1.1) 27 | activemodel (= 4.1.1) 28 | activesupport (= 4.1.1) 29 | arel (~> 5.0.0) 30 | activesupport (4.1.1) 31 | i18n (~> 0.6, >= 0.6.9) 32 | json (~> 1.7, >= 1.7.7) 33 | minitest (~> 5.1) 34 | thread_safe (~> 0.1) 35 | tzinfo (~> 1.1) 36 | appraisal (1.0.2) 37 | bundler 38 | rake 39 | thor (>= 0.14.0) 40 | arel (5.0.1.20140414130214) 41 | builder (3.2.2) 42 | capybara (2.2.1) 43 | mime-types (>= 1.16) 44 | nokogiri (>= 1.3.3) 45 | rack (>= 1.0.0) 46 | rack-test (>= 0.5.4) 47 | xpath (~> 2.0) 48 | coveralls (0.7.0) 49 | multi_json (~> 1.3) 50 | rest-client 51 | simplecov (>= 0.7) 52 | term-ansicolor 53 | thor 54 | diff-lcs (1.2.5) 55 | docile (1.1.5) 56 | erubis (2.7.0) 57 | hike (1.2.3) 58 | i18n (0.6.11) 59 | jquery-rails (3.1.1) 60 | railties (>= 3.0, < 5.0) 61 | thor (>= 0.14, < 2.0) 62 | json (1.8.1) 63 | mail (2.5.4) 64 | mime-types (~> 1.16) 65 | treetop (~> 1.4.8) 66 | mime-types (1.25.1) 67 | mini_portile (0.6.0) 68 | minitest (5.4.0) 69 | multi_json (1.10.1) 70 | nokogiri (1.6.3.1) 71 | mini_portile (= 0.6.0) 72 | polyglot (0.3.5) 73 | rack (1.5.2) 74 | rack-test (0.6.2) 75 | rack (>= 1.0) 76 | rails (4.1.1) 77 | actionmailer (= 4.1.1) 78 | actionpack (= 4.1.1) 79 | actionview (= 4.1.1) 80 | activemodel (= 4.1.1) 81 | activerecord (= 4.1.1) 82 | activesupport (= 4.1.1) 83 | bundler (>= 1.3.0, < 2.0) 84 | railties (= 4.1.1) 85 | sprockets-rails (~> 2.0) 86 | railties (4.1.1) 87 | actionpack (= 4.1.1) 88 | activesupport (= 4.1.1) 89 | rake (>= 0.8.7) 90 | thor (>= 0.18.1, < 2.0) 91 | rake (10.3.2) 92 | rest-client (1.6.7) 93 | mime-types (>= 1.16) 94 | rspec (2.14.1) 95 | rspec-core (~> 2.14.0) 96 | rspec-expectations (~> 2.14.0) 97 | rspec-mocks (~> 2.14.0) 98 | rspec-core (2.14.8) 99 | rspec-expectations (2.14.5) 100 | diff-lcs (>= 1.1.3, < 2.0) 101 | rspec-html-matchers (0.5.0) 102 | nokogiri (~> 1) 103 | rspec (~> 2, >= 2.11.0) 104 | rspec-mocks (2.14.6) 105 | rspec-rails (2.14.2) 106 | actionpack (>= 3.0) 107 | activemodel (>= 3.0) 108 | activesupport (>= 3.0) 109 | railties (>= 3.0) 110 | rspec-core (~> 2.14.0) 111 | rspec-expectations (~> 2.14.0) 112 | rspec-mocks (~> 2.14.0) 113 | simplecov (0.9.0) 114 | docile (~> 1.1.0) 115 | multi_json 116 | simplecov-html (~> 0.8.0) 117 | simplecov-html (0.8.0) 118 | sprockets (2.11.0) 119 | hike (~> 1.2) 120 | multi_json (~> 1.0) 121 | rack (~> 1.0) 122 | tilt (~> 1.1, != 1.3.0) 123 | sprockets-rails (2.1.3) 124 | actionpack (>= 3.0) 125 | activesupport (>= 3.0) 126 | sprockets (~> 2.8) 127 | sqlite3 (1.3.9) 128 | term-ansicolor (1.3.0) 129 | tins (~> 1.0) 130 | thor (0.19.1) 131 | thread_safe (0.3.4) 132 | tilt (1.4.1) 133 | tins (1.0.0) 134 | treetop (1.4.15) 135 | polyglot 136 | polyglot (>= 0.3.1) 137 | tzinfo (1.2.1) 138 | thread_safe (~> 0.1) 139 | xpath (2.0.0) 140 | nokogiri (~> 1.3) 141 | 142 | PLATFORMS 143 | ruby 144 | 145 | DEPENDENCIES 146 | appraisal (~> 1.0.2) 147 | capybara (~> 2.2.0) 148 | coveralls 149 | jquery-rails 150 | nav_lynx! 151 | rails (= 4.1.1) 152 | rake 153 | rspec-html-matchers (< 0.6.0) 154 | rspec-rails (~> 2.14.0) 155 | sqlite3 156 | -------------------------------------------------------------------------------- /lib/nav_lynx.rb: -------------------------------------------------------------------------------- 1 | module NavLYNX 2 | mattr_accessor :selected_class 3 | end 4 | 5 | require "nav_lynx/engine" 6 | -------------------------------------------------------------------------------- /lib/nav_lynx/engine.rb: -------------------------------------------------------------------------------- 1 | module NavLYNX 2 | class Engine < ::Rails::Engine 3 | config.nav_lynx = ActiveSupport::OrderedOptions.new 4 | 5 | config.generators do |g| 6 | g.test_framework :rspec, :fixture => false 7 | end 8 | 9 | initializer "redirector.apply_options" do |app| 10 | NavLYNX.selected_class = app.config.nav_lynx.selected_class || 'selected' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/nav_lynx/version.rb: -------------------------------------------------------------------------------- 1 | module NavLYNX 2 | VERSION = "1.1.1" 3 | end 4 | -------------------------------------------------------------------------------- /nav_lynx.gemspec: -------------------------------------------------------------------------------- 1 | $:.push File.expand_path("../lib", __FILE__) 2 | 3 | # Maintain your gem's version: 4 | require "nav_lynx/version" 5 | 6 | # Describe your gem and declare its dependencies: 7 | Gem::Specification.new do |s| 8 | s.name = "nav_lynx" 9 | s.version = NavLYNX::VERSION 10 | s.authors = ["Dan Tello", "Patrick Reagan", "Brian Landau"] 11 | s.email = ["dan.tello@viget.com", "patrick.reagan@viget.com", "brian.landau@viget.com"] 12 | s.homepage = "http://github.com/vigetlabs/nav_lynx" 13 | s.summary = "Rails helper to generate navigation links with a selected class." 14 | s.description = "Rails helper to generate navigation links with a selected class." 15 | 16 | s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"] 17 | s.test_files = Dir["spec/**/*"] 18 | s.require_paths = ["lib"] 19 | s.extra_rdoc_files = ["README.md"] 20 | 21 | s.add_dependency "rails", ">= 3.1.0" 22 | # s.add_dependency "jquery-rails" 23 | 24 | s.add_development_dependency "sqlite3" 25 | s.add_development_dependency 'rspec-rails', '~> 2.14.0' 26 | s.add_development_dependency 'capybara', '~> 2.2.0' 27 | s.add_development_dependency 'appraisal', '~> 1.0.2' 28 | s.add_development_dependency 'rspec-html-matchers', '< 0.6.0' 29 | s.add_development_dependency 'rake' 30 | s.add_development_dependency 'coveralls' 31 | end 32 | -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | ENGINE_ROOT = File.expand_path('../..', __FILE__) 5 | ENGINE_PATH = File.expand_path('../../lib/nav_lynx/engine', __FILE__) 6 | 7 | require 'rails/all' 8 | require 'rails/engine/commands' 9 | -------------------------------------------------------------------------------- /spec/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == Welcome to Rails 2 | 3 | Rails is a web-application framework that includes everything needed to create 4 | database-backed web applications according to the Model-View-Control pattern. 5 | 6 | This pattern splits the view (also called the presentation) into "dumb" 7 | templates that are primarily responsible for inserting pre-built data in between 8 | HTML tags. The model contains the "smart" domain objects (such as Account, 9 | Product, Person, Post) that holds all the business logic and knows how to 10 | persist themselves to a database. The controller handles the incoming requests 11 | (such as Save New Account, Update Product, Show Post) by manipulating the model 12 | and directing data to the view. 13 | 14 | In Rails, the model is handled by what's called an object-relational mapping 15 | layer entitled Active Record. This layer allows you to present the data from 16 | database rows as objects and embellish these data objects with business logic 17 | methods. You can read more about Active Record in 18 | link:files/vendor/rails/activerecord/README.html. 19 | 20 | The controller and view are handled by the Action Pack, which handles both 21 | layers by its two parts: Action View and Action Controller. These two layers 22 | are bundled in a single package due to their heavy interdependence. This is 23 | unlike the relationship between the Active Record and Action Pack that is much 24 | more separate. Each of these packages can be used independently outside of 25 | Rails. You can read more about Action Pack in 26 | link:files/vendor/rails/actionpack/README.html. 27 | 28 | 29 | == Getting Started 30 | 31 | 1. At the command prompt, create a new Rails application: 32 | rails new myapp (where myapp is the application name) 33 | 34 | 2. Change directory to myapp and start the web server: 35 | cd myapp; rails server (run with --help for options) 36 | 37 | 3. Go to http://localhost:3000/ and you'll see: 38 | "Welcome aboard: You're riding Ruby on Rails!" 39 | 40 | 4. Follow the guidelines to start developing your application. You can find 41 | the following resources handy: 42 | 43 | * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html 44 | * Ruby on Rails Tutorial Book: http://www.railstutorial.org/ 45 | 46 | 47 | == Debugging Rails 48 | 49 | Sometimes your application goes wrong. Fortunately there are a lot of tools that 50 | will help you debug it and get it back on the rails. 51 | 52 | First area to check is the application log files. Have "tail -f" commands 53 | running on the server.log and development.log. Rails will automatically display 54 | debugging and runtime information to these files. Debugging info will also be 55 | shown in the browser on requests from 127.0.0.1. 56 | 57 | You can also log your own messages directly into the log file from your code 58 | using the Ruby logger class from inside your controllers. Example: 59 | 60 | class WeblogController < ActionController::Base 61 | def destroy 62 | @weblog = Weblog.find(params[:id]) 63 | @weblog.destroy 64 | logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") 65 | end 66 | end 67 | 68 | The result will be a message in your log file along the lines of: 69 | 70 | Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1! 71 | 72 | More information on how to use the logger is at http://www.ruby-doc.org/core/ 73 | 74 | Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are 75 | several books available online as well: 76 | 77 | * Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe) 78 | * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) 79 | 80 | These two books will bring you up to speed on the Ruby language and also on 81 | programming in general. 82 | 83 | 84 | == Debugger 85 | 86 | Debugger support is available through the debugger command when you start your 87 | Mongrel or WEBrick server with --debugger. This means that you can break out of 88 | execution at any point in the code, investigate and change the model, and then, 89 | resume execution! You need to install ruby-debug to run the server in debugging 90 | mode. With gems, use sudo gem install ruby-debug. Example: 91 | 92 | class WeblogController < ActionController::Base 93 | def index 94 | @posts = Post.all 95 | debugger 96 | end 97 | end 98 | 99 | So the controller will accept the action, run the first line, then present you 100 | with a IRB prompt in the server window. Here you can do things like: 101 | 102 | >> @posts.inspect 103 | => "[#nil, "body"=>nil, "id"=>"1"}>, 105 | #"Rails", "body"=>"Only ten..", "id"=>"2"}>]" 107 | >> @posts.first.title = "hello from a debugger" 108 | => "hello from a debugger" 109 | 110 | ...and even better, you can examine how your runtime objects actually work: 111 | 112 | >> f = @posts.first 113 | => #nil, "body"=>nil, "id"=>"1"}> 114 | >> f. 115 | Display all 152 possibilities? (y or n) 116 | 117 | Finally, when you're ready to resume execution, you can enter "cont". 118 | 119 | 120 | == Console 121 | 122 | The console is a Ruby shell, which allows you to interact with your 123 | application's domain model. Here you'll have all parts of the application 124 | configured, just like it is when the application is running. You can inspect 125 | domain models, change values, and save to the database. Starting the script 126 | without arguments will launch it in the development environment. 127 | 128 | To start the console, run rails console from the application 129 | directory. 130 | 131 | Options: 132 | 133 | * Passing the -s, --sandbox argument will rollback any modifications 134 | made to the database. 135 | * Passing an environment name as an argument will load the corresponding 136 | environment. Example: rails console production. 137 | 138 | To reload your controllers and models after launching the console run 139 | reload! 140 | 141 | More information about irb can be found at: 142 | link:http://www.rubycentral.org/pickaxe/irb.html 143 | 144 | 145 | == dbconsole 146 | 147 | You can go to the command line of your database directly through rails 148 | dbconsole. You would be connected to the database with the credentials 149 | defined in database.yml. Starting the script without arguments will connect you 150 | to the development database. Passing an argument will connect you to a different 151 | database, like rails dbconsole production. Currently works for MySQL, 152 | PostgreSQL and SQLite 3. 153 | 154 | == Description of Contents 155 | 156 | The default directory structure of a generated Ruby on Rails application: 157 | 158 | |-- app 159 | | |-- assets 160 | | | |-- images 161 | | | |-- javascripts 162 | | | `-- stylesheets 163 | | |-- controllers 164 | | |-- helpers 165 | | |-- mailers 166 | | |-- models 167 | | `-- views 168 | | `-- layouts 169 | |-- config 170 | | |-- environments 171 | | |-- initializers 172 | | `-- locales 173 | |-- db 174 | |-- doc 175 | |-- lib 176 | | |-- assets 177 | | `-- tasks 178 | |-- log 179 | |-- public 180 | |-- script 181 | |-- test 182 | | |-- fixtures 183 | | |-- functional 184 | | |-- integration 185 | | |-- performance 186 | | `-- unit 187 | |-- tmp 188 | | `-- cache 189 | | `-- assets 190 | `-- vendor 191 | |-- assets 192 | | |-- javascripts 193 | | `-- stylesheets 194 | `-- plugins 195 | 196 | app 197 | Holds all the code that's specific to this particular application. 198 | 199 | app/assets 200 | Contains subdirectories for images, stylesheets, and JavaScript files. 201 | 202 | app/controllers 203 | Holds controllers that should be named like weblogs_controller.rb for 204 | automated URL mapping. All controllers should descend from 205 | ApplicationController which itself descends from ActionController::Base. 206 | 207 | app/models 208 | Holds models that should be named like post.rb. Models descend from 209 | ActiveRecord::Base by default. 210 | 211 | app/views 212 | Holds the template files for the view that should be named like 213 | weblogs/index.html.erb for the WeblogsController#index action. All views use 214 | eRuby syntax by default. 215 | 216 | app/views/layouts 217 | Holds the template files for layouts to be used with views. This models the 218 | common header/footer method of wrapping views. In your views, define a layout 219 | using the layout :default and create a file named default.html.erb. 220 | Inside default.html.erb, call <% yield %> to render the view using this 221 | layout. 222 | 223 | app/helpers 224 | Holds view helpers that should be named like weblogs_helper.rb. These are 225 | generated for you automatically when using generators for controllers. 226 | Helpers can be used to wrap functionality for your views into methods. 227 | 228 | config 229 | Configuration files for the Rails environment, the routing map, the database, 230 | and other dependencies. 231 | 232 | db 233 | Contains the database schema in schema.rb. db/migrate contains all the 234 | sequence of Migrations for your schema. 235 | 236 | doc 237 | This directory is where your application documentation will be stored when 238 | generated using rake doc:app 239 | 240 | lib 241 | Application specific libraries. Basically, any kind of custom code that 242 | doesn't belong under controllers, models, or helpers. This directory is in 243 | the load path. 244 | 245 | public 246 | The directory available for the web server. Also contains the dispatchers and the 247 | default HTML files. This should be set as the DOCUMENT_ROOT of your web 248 | server. 249 | 250 | script 251 | Helper scripts for automation and generation. 252 | 253 | test 254 | Unit and functional tests along with fixtures. When using the rails generate 255 | command, template test files will be generated for you and placed in this 256 | directory. 257 | 258 | vendor 259 | External libraries that the application depends on. Also includes the plugins 260 | subdirectory. If the app has frozen rails, those gems also go here, under 261 | vendor/rails/. This directory is in the load path. 262 | -------------------------------------------------------------------------------- /spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # Add your own tasks in files placed in lib/tasks ending in .rake, 3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 4 | 5 | require File.expand_path('../config/application', __FILE__) 6 | 7 | Dummy::Application.load_tasks 8 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // the compiled file. 9 | // 10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD 11 | // GO AFTER THE REQUIRES BELOW. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require_tree . 16 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | *= require_self 12 | *= require_tree . 13 | */ 14 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery 3 | end 4 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/dashboard_controller.rb: -------------------------------------------------------------------------------- 1 | class DashboardController < ApplicationController 2 | def show; end 3 | end 4 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/projects_controller.rb: -------------------------------------------------------------------------------- 1 | class ProjectsController < ApplicationController 2 | end 3 | -------------------------------------------------------------------------------- /spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /spec/dummy/app/mailers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vigetlabs/nav_lynx/8afb3259e6eb7505311aa18ef6713f0be34ab656/spec/dummy/app/mailers/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vigetlabs/nav_lynx/8afb3259e6eb7505311aa18ef6713f0be34ab656/spec/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/app/views/dashboard/show.html.erb: -------------------------------------------------------------------------------- 1 | <%= nav_link_to 'My Title', '/projects' %> 2 | -------------------------------------------------------------------------------- /spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag "application", :media => "all" %> 6 | <%= javascript_include_tag "application" %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Dummy::Application 5 | -------------------------------------------------------------------------------- /spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | # Pick the frameworks you want: 4 | require 'rails/all' 5 | # require "rails/test_unit/railtie" 6 | 7 | Bundler.require(*Rails.groups) 8 | require "nav_lynx" 9 | 10 | module Dummy 11 | class Application < Rails::Application 12 | # Settings in config/environments/* take precedence over those specified here. 13 | # Application configuration should go into files in config/initializers 14 | # -- all .rb files in that directory are automatically loaded. 15 | 16 | # Custom directories with classes and modules you want to be autoloadable. 17 | # config.autoload_paths += %W(#{config.root}/extras) 18 | 19 | # Only load the plugins named here, in the order given (default is alphabetical). 20 | # :all can be used as a placeholder for all plugins not explicitly named. 21 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 22 | 23 | # Activate observers that should always be running. 24 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 25 | 26 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 27 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 28 | # config.time_zone = 'Central Time (US & Canada)' 29 | 30 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 31 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 32 | # config.i18n.default_locale = :de 33 | 34 | # Configure the default encoding used in templates for Ruby 1.9. 35 | config.encoding = "utf-8" 36 | 37 | # Configure sensitive parameters which will be filtered from the log file. 38 | config.filter_parameters += [:password] 39 | 40 | # Enable escaping HTML in JSON. 41 | config.active_support.escape_html_entities_in_json = true 42 | 43 | # Use SQL instead of Active Record's schema dumper when creating the database. 44 | # This is necessary if your schema can't be completely dumped by the schema dumper, 45 | # like if you have constraints or database-specific column types 46 | # config.active_record.schema_format = :sql 47 | 48 | # Enable the asset pipeline 49 | config.assets.enabled = true 50 | 51 | # Version of your assets, change this if you want to expire all your assets 52 | config.assets.version = '1.0' 53 | end 54 | end 55 | 56 | -------------------------------------------------------------------------------- /spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | 6 | $:.unshift File.expand_path('../../../../lib', __FILE__) 7 | -------------------------------------------------------------------------------- /spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the rails application 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the rails application 5 | Dummy::Application.initialize! 6 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 11 | 12 | # Show full error reports and disable caching 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger 20 | config.active_support.deprecation = :log 21 | 22 | # Only use best-standards-support built into browsers 23 | config.action_dispatch.best_standards_support = :builtin 24 | 25 | # Do not compress assets 26 | config.assets.compress = false 27 | 28 | # Expands the lines which load the assets 29 | config.assets.debug = true 30 | 31 | config.eager_load = false 32 | end 33 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # Code is not reloaded between requests 5 | config.cache_classes = true 6 | 7 | # Full error reports are disabled and caching is turned on 8 | config.consider_all_requests_local = false 9 | config.action_controller.perform_caching = true 10 | 11 | # Disable Rails's static asset server (Apache or nginx will already do this) 12 | config.serve_static_assets = false 13 | 14 | # Compress JavaScripts and CSS 15 | config.assets.compress = true 16 | 17 | # Don't fallback to assets pipeline if a precompiled asset is missed 18 | config.assets.compile = false 19 | 20 | # Generate digests for assets URLs 21 | config.assets.digest = true 22 | 23 | # Defaults to nil and saved in location specified by config.assets.prefix 24 | # config.assets.manifest = YOUR_PATH 25 | 26 | # Specifies the header that your server uses for sending files 27 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 28 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 29 | 30 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 31 | # config.force_ssl = true 32 | 33 | # See everything in the log (default is :info) 34 | # config.log_level = :debug 35 | 36 | # Prepend all log lines with the following tags 37 | # config.log_tags = [ :subdomain, :uuid ] 38 | 39 | # Use a different logger for distributed setups 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 41 | 42 | # Use a different cache store in production 43 | # config.cache_store = :mem_cache_store 44 | 45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server 46 | # config.action_controller.asset_host = "http://assets.example.com" 47 | 48 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) 49 | # config.assets.precompile += %w( search.js ) 50 | 51 | # Disable delivery errors, bad email addresses will be ignored 52 | # config.action_mailer.raise_delivery_errors = false 53 | 54 | # Enable threaded mode 55 | # config.threadsafe! 56 | 57 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 58 | # the I18n.default_locale when a translation can not be found) 59 | config.i18n.fallbacks = true 60 | 61 | # Send deprecation notices to registered listeners 62 | config.active_support.deprecation = :notify 63 | 64 | # Log the query plan for queries taking more than this (works 65 | # with SQLite, MySQL, and PostgreSQL) 66 | # config.active_record.auto_explain_threshold_in_seconds = 0.5 67 | end 68 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Configure static asset server for tests with Cache-Control for performance 11 | config.serve_static_assets = true 12 | config.static_cache_control = "public, max-age=3600" 13 | 14 | # Log error messages when you accidentally call methods on nil 15 | config.whiny_nils = true 16 | 17 | # Show full error reports and disable caching 18 | config.consider_all_requests_local = true 19 | config.action_controller.perform_caching = false 20 | 21 | # Raise exceptions instead of rendering exception templates 22 | config.action_dispatch.show_exceptions = false 23 | 24 | # Disable request forgery protection in test environment 25 | config.action_controller.allow_forgery_protection = false 26 | 27 | # Tell Action Mailer not to deliver emails to the real world. 28 | # The :test delivery method accumulates sent emails in the 29 | # ActionMailer::Base.deliveries array. 30 | config.action_mailer.delivery_method = :test 31 | 32 | # Print deprecation notices to the stderr 33 | config.active_support.deprecation = :stderr 34 | 35 | config.eager_load = false 36 | end 37 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format 4 | # (all these examples are active by default): 5 | # ActiveSupport::Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | # 12 | # These inflection rules are supported but not enabled by default: 13 | # ActiveSupport::Inflector.inflections do |inflect| 14 | # inflect.acronym 'RESTful' 15 | # end 16 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | Dummy::Application.config.secret_token = 'b8d52a485343084904175882edbad223961e693126a625eae96e6988e9ce03658eee4446f0744b6d84c4b92b471aabc4dee74825a9da97248ee8744612dd3ba5' 8 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' 4 | 5 | # Use the database for sessions instead of the cookie-based default, 6 | # which shouldn't be used to store highly confidential information 7 | # (create the session table with "rails generate session_migration") 8 | # Dummy::Application.config.session_store :active_record_store 9 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # Disable root element in JSON by default. 12 | ActiveSupport.on_load(:active_record) do 13 | self.include_root_in_json = false 14 | end 15 | -------------------------------------------------------------------------------- /spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" 6 | -------------------------------------------------------------------------------- /spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.routes.draw do 2 | resources :projects 3 | root :to => 'dashboard#show' 4 | end 5 | -------------------------------------------------------------------------------- /spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended to check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(:version => 0) do 15 | 16 | end 17 | -------------------------------------------------------------------------------- /spec/dummy/lib/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vigetlabs/nav_lynx/8afb3259e6eb7505311aa18ef6713f0be34ab656/spec/dummy/lib/assets/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vigetlabs/nav_lynx/8afb3259e6eb7505311aa18ef6713f0be34ab656/spec/dummy/log/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The page you were looking for doesn't exist.

23 |

You may have mistyped the address or the page may have moved.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /spec/dummy/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The change you wanted was rejected.

23 |

Maybe you tried to change something you didn't have access to.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /spec/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

We're sorry, but something went wrong.

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vigetlabs/nav_lynx/8afb3259e6eb7505311aa18ef6713f0be34ab656/spec/dummy/public/favicon.ico -------------------------------------------------------------------------------- /spec/dummy/script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /spec/features/navigation_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe "Rendering navigation links" do 4 | it "renders the link correctly" do 5 | visit '/' 6 | 7 | page.should have_link("My Title", :href => "/projects") 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/helpers/nav_link_helper_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe NavLinkHelper do 4 | describe '#nav_link' do 5 | let(:link_generator) do 6 | lg = double("LinkGenerator") 7 | lg.stub(:to_html => true) 8 | lg 9 | end 10 | 11 | before { helper.stub(:request => :request) } 12 | 13 | it 'accepts only a title and a path' do 14 | NavLinkHelper::LinkGenerator.should_receive(:new).with(:request, "My Title", "/path", controller, {}, {}) 15 | .and_return(link_generator) 16 | 17 | helper.nav_link_to("My Title", "/path") 18 | end 19 | 20 | it 'accepts a block that returns the title' do 21 | NavLinkHelper::LinkGenerator.should_receive(:new).with(:request, "My Title", "/path", controller, {}, {}) 22 | .and_return(link_generator) 23 | 24 | helper.nav_link_to("/path") do 25 | "My Title" 26 | end 27 | end 28 | 29 | it "accepts options and html_options parameters" do 30 | NavLinkHelper::LinkGenerator.should_receive(:new).with(:request, "My Title", "/path", controller, :html_options, :options) 31 | .and_return(link_generator) 32 | 33 | helper.nav_link_to("My Title", "/path", :html_options, :options) 34 | end 35 | end 36 | 37 | describe NavLinkHelper::LinkGenerator do 38 | describe '#to_html' do 39 | subject { described_class::LinkGenerator } 40 | let(:request){ helper.request } 41 | after { NavLYNX.selected_class = 'selected' } 42 | 43 | it "outputs a simple link when appropriate" do 44 | subject.new(request, 'Hi', '/projects', controller).to_html.should == 'Hi' 45 | end 46 | 47 | it "accepts a hash for the URL parameter" do 48 | subject.new(request, 'Hi', {:controller => 'projects', :action => 'index'}, controller).to_html.should == 'Hi' 49 | end 50 | 51 | it "knows when to flag the link as current" do 52 | request.stub(:fullpath).and_return('/projects') 53 | subject.new(request, 'Hi', '/projects', controller).to_html.should have_tag("a.selected[href='/projects']", :text => "Hi") 54 | end 55 | 56 | it "knows use a globally defined selected class different from the default" do 57 | NavLYNX.selected_class = 'current' 58 | request.stub(:fullpath).and_return('/projects') 59 | subject.new(request, 'Hi', '/projects', controller).to_html.should have_tag("a.current[href='/projects']", :text => "Hi") 60 | end 61 | 62 | it "does not flag the link as current if there are parameters in the path" do 63 | request.stub(:fullpath).and_return('/projects?all=true') 64 | subject.new(request, 'Hi', '/projects', controller).to_html.should == 'Hi' 65 | end 66 | 67 | it "flags the link as selected if there are parameters in the path but we are ignoring parameters" do 68 | request.stub(:fullpath).and_return('/projects?all=true') 69 | subject.new(request, 'Hi', '/projects', controller, {}, {:ignore_params => true}).to_html 70 | .should have_tag("a.selected[href='/projects']", :text => "Hi") 71 | end 72 | 73 | it "allows the specification of an alternate selected class" do 74 | request.stub(:fullpath).and_return('/projects') 75 | subject.new(request, 'Hi', '/projects', controller, {}, {:selected_class => 'current'}).to_html 76 | .should have_tag("a.current[href='/projects']", :text => "Hi") 77 | end 78 | 79 | it "generates a wrapper for the link when specified" do 80 | subject.new(request, 'Hi', '/projects', controller, {}, {:wrapper => 'li'}).to_html 81 | .should == '
  • Hi
  • ' 82 | end 83 | 84 | it "provides a class for the wrapper when specified" do 85 | subject.new(request, 'Hi', '/projects', controller, {}, {:wrapper => 'li', :wrapper_class => 'container'}).to_html 86 | .should == '
  • Hi
  • ' 87 | end 88 | 89 | it "provides a class for the selected wrapper when specified" do 90 | request.stub(:fullpath).and_return('/projects') 91 | subject.new(request, 'Hi', '/projects', controller, {}, {:wrapper => 'li', :selected_class => 'special-selected'}).to_html 92 | .should == '
  • Hi
  • ' 93 | end 94 | 95 | it "provides a class for the wrapper when specified along with a selected class if neeeded" do 96 | request.stub(:fullpath).and_return('/projects') 97 | subject.new(request, 'Hi', '/projects', controller, {}, {:wrapper => 'li', :wrapper_class => 'container'}).to_html 98 | .should == '
  • Hi
  • ' 99 | end 100 | 101 | it "allows specification of the link classes" do 102 | subject.new(request, 'Hi', '/projects', controller, {:class => 'one two'}, {}).to_html 103 | .should have_tag("a.one.two[href='/projects']", :text => "Hi") 104 | end 105 | 106 | it "combines custom link classes when the link is selected" do 107 | request.stub(:fullpath).and_return('/projects') 108 | subject.new(request, 'Hi', '/projects', controller, {:class => 'one two'}, {}).to_html 109 | .should have_tag("a.selected.one.two[href='/projects']", :text => "Hi") 110 | end 111 | 112 | it "ignores the ID in the path when provided with a segment" do 113 | request.stub(:fullpath).and_return('/projects/2') 114 | subject.new(request, 'Hi', '/projects', controller, {}, {:url_segment => 1}).to_html 115 | .should have_tag("a.selected[href='/projects']", :text => "Hi") 116 | end 117 | 118 | it "handles deep URL segments" do 119 | request.stub(:fullpath).and_return('/projects/2/3') 120 | subject.new(request, 'Hi', '/projects/2', controller, {}, {:url_segment => 2}).to_html 121 | .should have_tag("a.selected[href='/projects/2']", :text => "Hi") 122 | end 123 | 124 | it "knows to not match on the first segment when requested" do 125 | request.stub(:fullpath).and_return('/projects/2/3') 126 | subject.new(request, 'Hi', '/projects/1', controller, {}, {:url_segment => 2}).to_html 127 | .should == 'Hi' 128 | end 129 | 130 | it "handles matching on the controller segment" do 131 | Rails.application.routes.stub(:recognize_path).with('/members/1').and_return(:controller => 'members') 132 | Rails.application.routes.stub(:recognize_path).with('/members/pages/1').and_return(:controller => 'members') 133 | 134 | request.stub(:fullpath).and_return('/members/pages/1') 135 | request.stub(:path).and_return('/members/pages/1') 136 | 137 | subject.new(request, 'Hi', '/members/1', controller, {}, {:controller_segment => 1}).to_html 138 | .should have_tag("a.selected[href='/members/1']", :text => "Hi") 139 | end 140 | 141 | it "handles the case when the current request path is a POST route & has no GET route" do 142 | # scenario where a route exists only for POST, so GET fails 143 | Rails.application.routes.stub(:recognize_path).with('/projects/something').and_raise(ActionController::RoutingError.new("No route matches '/projects'")) 144 | Rails.application.routes.stub(:recognize_path).with('/projects').and_return(:controller => 'projects', :action => 'index') 145 | 146 | request.stub(:fullpath => '/projects/something', :path => '/projects/something') 147 | subject.new(request, 'Hi', '/projects', controller).to_html.should == 'Hi' 148 | end 149 | end 150 | end 151 | end 152 | 153 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= 'test' 2 | require 'coveralls' 3 | Coveralls.wear! 'rails' 4 | 5 | require File.expand_path("../dummy/config/environment.rb", __FILE__) 6 | require 'rspec/rails' 7 | require 'rspec/autorun' 8 | require 'capybara/rails' 9 | require 'capybara/rspec' 10 | require 'rspec-html-matchers' 11 | 12 | Rails.backtrace_cleaner.remove_silencers! 13 | 14 | # Requires supporting ruby files with custom matchers and macros, etc, 15 | # in spec/support/ and its subdirectories. 16 | Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } 17 | 18 | RSpec.configure do |config| 19 | # If you're not using ActiveRecord, or you'd prefer not to run each of your 20 | # examples within a transaction, remove the following line or assign false 21 | # instead of true. 22 | config.use_transactional_fixtures = true 23 | 24 | # If true, the base class of anonymous controllers will be inferred 25 | # automatically. This will be the default behavior in future versions of 26 | # rspec-rails. 27 | config.infer_base_class_for_anonymous_controllers = false 28 | 29 | # Run specs in random order to surface order dependencies. If you find an 30 | # order dependency and want to debug it, you can fix the order by providing 31 | # the seed, which is printed after each run. 32 | # --seed 1234 33 | config.order = "random" 34 | end 35 | --------------------------------------------------------------------------------