campfire_logic 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. data/Gemfile +2 -8
  2. data/Gemfile.local +3 -7
  3. data/README.rdoc +2 -2
  4. data/Rakefile +3 -9
  5. data/VERSION +1 -1
  6. data/app/views/layouts/application.html.erb +0 -1
  7. data/campfire_logic.gemspec +16 -38
  8. data/config/application.rb +2 -35
  9. data/config/boot.rb +1 -3
  10. data/config/cucumber.yml +1 -1
  11. data/config/environment.rb +1 -4
  12. data/config/environments/test.rb +1 -26
  13. data/config/initializers/campfire_logic.rb +1 -1
  14. data/config/initializers/metric_fu.rb +3 -3
  15. data/config/initializers/secret_token.rb +1 -7
  16. data/config/initializers/session_store.rb +1 -8
  17. data/config/mongoid.yml +1 -20
  18. data/config/routes.rb +8 -62
  19. data/config.ru +1 -3
  20. data/db/seeds.rb +1 -2
  21. data/features/support/env.rb +37 -17
  22. data/lib/tasks/cucumber.rake +13 -19
  23. data/spec/controllers/directory_controller_spec.rb +1 -1
  24. data/spec/controllers/services_controller_spec.rb +1 -3
  25. data/spec/models/locale_spec.rb +1 -1
  26. data/spec/models/location_import_spec.rb +1 -1
  27. data/spec/models/location_spec.rb +1 -1
  28. metadata +16 -47
  29. data/Capfile +0 -4
  30. data/app/models/google_maps_geocoder.rb +0 -108
  31. data/config/deploy.rb +0 -40
  32. data/config/environments/development.rb +0 -28
  33. data/config/environments/production.rb +0 -49
  34. data/doc/google_maps_response.rb +0 -56
  35. data/init.rb +0 -1
  36. data/public/404.html +0 -26
  37. data/public/422.html +0 -26
  38. data/public/500.html +0 -26
  39. data/public/favicon.ico +0 -0
  40. data/public/javascripts/application.js +0 -2
  41. data/public/javascripts/controls.js +0 -965
  42. data/public/javascripts/dragdrop.js +0 -974
  43. data/public/javascripts/effects.js +0 -1123
  44. data/public/javascripts/prototype.js +0 -6001
  45. data/public/javascripts/rails.js +0 -175
  46. data/public/robots.txt +0 -6
  47. data/spec/models/google_maps_geocoder_spec.rb +0 -62
data/Gemfile CHANGED
@@ -1,15 +1,13 @@
1
1
  source 'http://rubygems.org'
2
- source 'http://jose.seologic.com:8808/'
3
2
 
4
3
  gem 'bson_ext'
5
4
  gem 'fastercsv'
5
+ gem 'google_maps_geocoder'
6
6
  gem 'mongoid-tree'
7
- gem 'rake'
8
- gem 'rails', '>= 3.0'
7
+ gem 'rails', '3.0.10'
9
8
  gem 'scaffold_logic'
10
9
  gem 'stateflow'
11
10
  gem 'stringex'
12
- gem 'SystemTimer'
13
11
 
14
12
  group :development do
15
13
  gem 'jeweler'
@@ -17,13 +15,9 @@ end
17
15
 
18
16
  group :test do
19
17
  gem 'be_valid_asset'
20
- gem 'capybara'
21
18
  gem 'cucumber-rails'
22
19
  gem 'database_cleaner'
23
20
  gem 'launchy'
24
- gem 'metric_fu'
25
21
  gem 'mocha'
26
- gem 'nokogiri'
27
- gem 'rcov'
28
22
  gem 'rspec-rails'
29
23
  end
data/Gemfile.local CHANGED
@@ -1,12 +1,10 @@
1
1
  source 'http://rubygems.org'
2
- source 'http://jose.seologic.com:8808/'
3
2
 
4
3
  gem 'bson_ext'
5
4
  gem 'fastercsv'
6
- gem 'mongo', '>= 1.0.7'
7
- gem 'mongoid', '>= 2.0.0.beta.20'
5
+ gem 'google_maps_geocoder'
8
6
  gem 'mongoid-tree'
9
- gem 'rails'
7
+ gem 'rails', '3.0.10'
10
8
  gem 'scaffold_logic', :path => '~/Documents/projects/scaffold_logic'
11
9
  gem 'stateflow'
12
10
  gem 'stringex'
@@ -16,12 +14,10 @@ group :development do
16
14
  end
17
15
 
18
16
  group :test do
19
- gem 'capybara'
17
+ gem 'be_valid_asset'
20
18
  gem 'cucumber-rails'
21
19
  gem 'database_cleaner'
22
20
  gem 'launchy'
23
21
  gem 'mocha'
24
- gem 'nokogiri'
25
- gem 'rcov'
26
22
  gem 'rspec-rails'
27
23
  end
data/README.rdoc CHANGED
@@ -3,7 +3,7 @@
3
3
  The engine that powers CAMP. Provides location browsing, search, and management.
4
4
 
5
5
  == Note on Patches/Pull Requests
6
-
6
+
7
7
  * Fork the project.
8
8
  * Make your feature addition or bug fix.
9
9
  * Add tests for it. This is important so I don't break it in a
@@ -14,4 +14,4 @@ The engine that powers CAMP. Provides location browsing, search, and management.
14
14
 
15
15
  == Copyright
16
16
 
17
- Copyright (c) 2010 Roderick Monje. See LICENSE for details.
17
+ Copyright © 2010 Roderick Monje. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,12 +1,10 @@
1
- require 'metric_fu'
1
+ require 'metric_fu' if Object.const_defined? 'MetricFu'
2
2
  require 'rake'
3
3
  require 'rspec/core/rake_task'
4
4
  require 'rubygems'
5
5
  require File.expand_path('../config/application', __FILE__)
6
-
7
6
  CampfireLogic::Application.load_tasks
8
7
  Rspec::Core::RakeTask.new
9
-
10
8
  begin
11
9
  require 'jeweler'
12
10
  Jeweler::Tasks.new do |gem|
@@ -17,27 +15,23 @@ begin
17
15
  gem.homepage = 'http://github.com/ivanoblomov/campfire_logic'
18
16
  gem.authors = ['Roderick Monje']
19
17
  gem.add_development_dependency 'rspec', '>= 1.2.9'
20
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
21
18
  end
22
19
  Jeweler::GemcutterTasks.new
23
20
  rescue LoadError
24
21
  puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
25
22
  end
26
-
27
- require 'rake/rdoctask'
23
+ require 'rdoc/task'
28
24
  Rake::RDocTask.new do |rdoc|
29
25
  version = File.exist?('VERSION') ? File.read('VERSION') : ''
30
-
31
26
  rdoc.rdoc_dir = 'rdoc'
32
27
  rdoc.title = "CampfireLogic #{version}"
33
28
  rdoc.rdoc_files.include('README*')
34
29
  rdoc.rdoc_files.include('lib/**/*.rb')
35
30
  end
36
-
37
31
  namespace :spec do
38
32
  desc 'Run specs with RCov'
39
33
  RSpec::Core::RakeTask.new('rcov') do |t|
40
34
  t.rcov = true
41
35
  t.rcov_opts = IO.readlines('spec/rcov.opts').map{ |l| l.chomp.split } * ' '
42
36
  end
43
- end
37
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.7
1
+ 1.1.8
@@ -11,7 +11,6 @@
11
11
  <!--[if IE]>
12
12
  <%= stylesheet_link_tag 'core_ie', :media => :all -%>
13
13
  <![endif]-->
14
- <%= javascript_include_tag :defaults, :cache => true -%>
15
14
  <%= csrf_meta_tag -%>
16
15
  </head>
17
16
  <body>
@@ -4,19 +4,18 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{campfire_logic}
8
- s.version = "1.1.7"
7
+ s.name = "campfire_logic"
8
+ s.version = "1.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Roderick Monje}]
12
- s.date = %q{2011-07-17}
13
- s.description = %q{Users can browse locations by country, city, and state and search locations by string or zip code. Administrators can manage locations and the services they offer.}
14
- s.email = %q{rod@seologic.com}
11
+ s.authors = ["Roderick Monje"]
12
+ s.date = "2011-11-30"
13
+ s.description = "Users can browse locations by country, city, and state and search locations by string or zip code. Administrators can manage locations and the services they offer."
14
+ s.email = "rod@seologic.com"
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
18
18
  s.files = [
19
- "Capfile",
20
19
  "Gemfile",
21
20
  "Gemfile.local",
22
21
  "README.rdoc",
@@ -27,7 +26,6 @@ Gem::Specification.new do |s|
27
26
  "app/controllers/locations_controller.rb",
28
27
  "app/controllers/services_controller.rb",
29
28
  "app/helpers/application_helper.rb",
30
- "app/models/google_maps_geocoder.rb",
31
29
  "app/models/locale.rb",
32
30
  "app/models/location.rb",
33
31
  "app/models/location_import.rb",
@@ -61,10 +59,7 @@ Gem::Specification.new do |s|
61
59
  "config/application.rb",
62
60
  "config/boot.rb",
63
61
  "config/cucumber.yml",
64
- "config/deploy.rb",
65
62
  "config/environment.rb",
66
- "config/environments/development.rb",
67
- "config/environments/production.rb",
68
63
  "config/environments/test.rb",
69
64
  "config/initializers/campfire_logic.rb",
70
65
  "config/initializers/metric_fu.rb",
@@ -75,7 +70,6 @@ Gem::Specification.new do |s|
75
70
  "config/routes.rb",
76
71
  "db/seeds.rb",
77
72
  "db/zip_codes.txt",
78
- "doc/google_maps_response.rb",
79
73
  "features/admin_manages_locations.feature",
80
74
  "features/customer_browses_directory.feature",
81
75
  "features/customer_searches_directory.feature",
@@ -85,16 +79,11 @@ Gem::Specification.new do |s|
85
79
  "features/support/env.rb",
86
80
  "features/support/paths.rb",
87
81
  "features/support/selectors.rb",
88
- "init.rb",
89
82
  "lib/campfire_logic.rb",
90
83
  "lib/campfire_logic/engine.rb",
91
84
  "lib/campfire_logic/railtie.rb",
92
85
  "lib/tasks/campfire_logic.rake",
93
86
  "lib/tasks/cucumber.rake",
94
- "public/404.html",
95
- "public/422.html",
96
- "public/500.html",
97
- "public/favicon.ico",
98
87
  "public/images/icons/collapsed.gif",
99
88
  "public/images/icons/delete.png",
100
89
  "public/images/icons/drag.png",
@@ -133,13 +122,6 @@ Gem::Specification.new do |s|
133
122
  "public/images/layout/th_bg_selected.png",
134
123
  "public/images/rails.png",
135
124
  "public/index.html",
136
- "public/javascripts/application.js",
137
- "public/javascripts/controls.js",
138
- "public/javascripts/dragdrop.js",
139
- "public/javascripts/effects.js",
140
- "public/javascripts/prototype.js",
141
- "public/javascripts/rails.js",
142
- "public/robots.txt",
143
125
  "public/sample-locations.xls",
144
126
  "public/stylesheets/.gitkeep",
145
127
  "public/stylesheets/application.css",
@@ -150,7 +132,6 @@ Gem::Specification.new do |s|
150
132
  "script/rails",
151
133
  "spec/controllers/directory_controller_spec.rb",
152
134
  "spec/controllers/services_controller_spec.rb",
153
- "spec/models/google_maps_geocoder_spec.rb",
154
135
  "spec/models/locale_spec.rb",
155
136
  "spec/models/location_import_spec.rb",
156
137
  "spec/models/location_spec.rb",
@@ -158,10 +139,10 @@ Gem::Specification.new do |s|
158
139
  "spec/spec_helper.rb",
159
140
  "spec/test-locations.xls"
160
141
  ]
161
- s.homepage = %q{http://github.com/ivanoblomov/campfire_logic}
162
- s.require_paths = [%q{lib}]
163
- s.rubygems_version = %q{1.8.5}
164
- s.summary = %q{Rails engine that adds a location directory to your web app}
142
+ s.homepage = "http://github.com/ivanoblomov/campfire_logic"
143
+ s.require_paths = ["lib"]
144
+ s.rubygems_version = "1.8.10"
145
+ s.summary = "Rails engine that adds a location directory to your web app"
165
146
 
166
147
  if s.respond_to? :specification_version then
167
148
  s.specification_version = 3
@@ -169,38 +150,35 @@ Gem::Specification.new do |s|
169
150
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
170
151
  s.add_runtime_dependency(%q<bson_ext>, [">= 0"])
171
152
  s.add_runtime_dependency(%q<fastercsv>, [">= 0"])
153
+ s.add_runtime_dependency(%q<google_maps_geocoder>, [">= 0"])
172
154
  s.add_runtime_dependency(%q<mongoid-tree>, [">= 0"])
173
- s.add_runtime_dependency(%q<rake>, [">= 0"])
174
- s.add_runtime_dependency(%q<rails>, [">= 3.0"])
155
+ s.add_runtime_dependency(%q<rails>, ["= 3.0.10"])
175
156
  s.add_runtime_dependency(%q<scaffold_logic>, [">= 0"])
176
157
  s.add_runtime_dependency(%q<stateflow>, [">= 0"])
177
158
  s.add_runtime_dependency(%q<stringex>, [">= 0"])
178
- s.add_runtime_dependency(%q<SystemTimer>, [">= 0"])
179
159
  s.add_development_dependency(%q<jeweler>, [">= 0"])
180
160
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
181
161
  else
182
162
  s.add_dependency(%q<bson_ext>, [">= 0"])
183
163
  s.add_dependency(%q<fastercsv>, [">= 0"])
164
+ s.add_dependency(%q<google_maps_geocoder>, [">= 0"])
184
165
  s.add_dependency(%q<mongoid-tree>, [">= 0"])
185
- s.add_dependency(%q<rake>, [">= 0"])
186
- s.add_dependency(%q<rails>, [">= 3.0"])
166
+ s.add_dependency(%q<rails>, ["= 3.0.10"])
187
167
  s.add_dependency(%q<scaffold_logic>, [">= 0"])
188
168
  s.add_dependency(%q<stateflow>, [">= 0"])
189
169
  s.add_dependency(%q<stringex>, [">= 0"])
190
- s.add_dependency(%q<SystemTimer>, [">= 0"])
191
170
  s.add_dependency(%q<jeweler>, [">= 0"])
192
171
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
193
172
  end
194
173
  else
195
174
  s.add_dependency(%q<bson_ext>, [">= 0"])
196
175
  s.add_dependency(%q<fastercsv>, [">= 0"])
176
+ s.add_dependency(%q<google_maps_geocoder>, [">= 0"])
197
177
  s.add_dependency(%q<mongoid-tree>, [">= 0"])
198
- s.add_dependency(%q<rake>, [">= 0"])
199
- s.add_dependency(%q<rails>, [">= 3.0"])
178
+ s.add_dependency(%q<rails>, ["= 3.0.10"])
200
179
  s.add_dependency(%q<scaffold_logic>, [">= 0"])
201
180
  s.add_dependency(%q<stateflow>, [">= 0"])
202
181
  s.add_dependency(%q<stringex>, [">= 0"])
203
- s.add_dependency(%q<SystemTimer>, [">= 0"])
204
182
  s.add_dependency(%q<jeweler>, [">= 0"])
205
183
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
206
184
  end
@@ -1,44 +1,11 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
-
3
2
  require 'action_controller/railtie'
4
3
  require 'action_mailer/railtie'
5
4
  require 'active_resource/railtie'
6
-
7
- # If you have a Gemfile, require the gems listed there, including any gems
8
- # you've limited to :test, :development, or :production.
9
5
  Bundler.require(:default, Rails.env) if defined?(Bundler)
10
-
11
6
  module CampfireLogic
12
7
  class Application < Rails::Application
13
- # Settings in config/environments/* take precedence over those specified here.
14
- # Application configuration should go into files in config/initializers
15
- # -- all .rb files in that directory are automatically loaded.
16
-
17
- # Custom directories with classes and modules you want to be autoloadable.
18
- # config.autoload_paths += %W(#{config.root}/extras)
19
-
20
- # Only load the plugins named here, in the order given (default is alphabetical).
21
- # :all can be used as a placeholder for all plugins not explicitly named.
22
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
23
-
24
- # Activate observers that should always be running.
25
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
26
-
27
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
28
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
29
- # config.time_zone = 'Central Time (US & Canada)'
30
-
31
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
32
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
33
- # config.i18n.default_locale = :de
34
-
35
- # JavaScript files you want as :defaults (application.js is always included).
36
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
37
-
38
- # Configure the default encoding used in templates for Ruby 1.9.
39
- config.encoding = "utf-8"
40
-
41
- # Configure sensitive parameters which will be filtered from the log file.
8
+ config.encoding = 'utf-8'
42
9
  config.filter_parameters += [:password]
43
10
  end
44
- end
11
+ end
data/config/boot.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  require 'rubygems'
2
-
3
- # Set up gems listed in the Gemfile.
4
2
  gemfile = File.expand_path('../../Gemfile', __FILE__)
5
3
  begin
6
4
  ENV['BUNDLE_GEMFILE'] = gemfile
@@ -10,4 +8,4 @@ rescue Bundler::GemNotFound => e
10
8
  STDERR.puts e.message
11
9
  STDERR.puts "Try running `bundle install`."
12
10
  exit!
13
- end if File.exist?(gemfile)
11
+ end if File.exist?(gemfile)
data/config/cucumber.yml CHANGED
@@ -7,4 +7,4 @@ int_opts = "#{std_opts} -o tmp/feature_results.txt"
7
7
  default: <%= std_opts %> features
8
8
  wip: --tags @wip:3 --wip features
9
9
  rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
10
- integration: <%= int_opts %> features
10
+ integration: <%= int_opts %> features
@@ -1,6 +1,3 @@
1
- # Load the rails application
2
1
  require File.expand_path('../application', __FILE__)
3
2
  require File.expand_path('../../lib/campfire_logic', __FILE__)
4
-
5
- # Initialize the rails application
6
- CampfireLogic::Application.initialize!
3
+ CampfireLogic::Application.initialize!
@@ -1,35 +1,10 @@
1
1
  CampfireLogic::Application.configure do
2
- # Settings specified here will take precedence over those in config/environment.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
2
  config.cache_classes = true
9
-
10
- # Log error messages when you accidentally call methods on nil.
11
3
  config.whiny_nils = true
12
-
13
- # Show full error reports and disable caching
14
4
  config.consider_all_requests_local = true
15
5
  config.action_controller.perform_caching = false
16
-
17
- # Raise exceptions instead of rendering exception templates
18
6
  config.action_dispatch.show_exceptions = false
19
-
20
- # Disable request forgery protection in test environment
21
7
  config.action_controller.allow_forgery_protection = false
22
-
23
- # Tell Action Mailer not to deliver emails to the real world.
24
- # The :test delivery method accumulates sent emails in the
25
- # ActionMailer::Base.deliveries array.
26
8
  config.action_mailer.delivery_method = :test
27
-
28
- # Use SQL instead of Active Record's schema dumper when creating the test database.
29
- # This is necessary if your schema can't be completely dumped by the schema dumper,
30
- # like if you have constraints or database-specific column types
31
- # config.active_record.schema_format = :sql
32
-
33
- # Print deprecation notices to the stderr
34
9
  config.active_support.deprecation = :stderr
35
- end
10
+ end
@@ -1,3 +1,3 @@
1
1
  CampfireLogic.setup do |config|
2
2
  config.directory_slug = 'directory'
3
- end
3
+ end
@@ -1,9 +1,9 @@
1
- if Rails.env.test?
1
+ if Rails.env.test? && Object.const_defined?('MetricFu')
2
2
  require 'metric_fu'
3
3
  MetricFu::Configuration.run do |config|
4
4
  config.metrics = [:churn, :saikuro, :stats, :flog, :flay]
5
5
  config.graphs = [:flog, :flay, :stats]
6
6
  config.rcov[:test_files] = ['spec/**/*_spec.rb']
7
- config.rcov[:rcov_opts] << '-Ispec' # Needed to find spec_helper
7
+ config.rcov[:rcov_opts] << '-Ispec'
8
8
  end
9
- end
9
+ end
@@ -1,7 +1 @@
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
- Rails.application.config.secret_token = '7e7d63cc40339d7c0413b464087c8f33c7811b85adc81916521c2b83848407ef03b446f847b08f124f69cb55d81e2232fb718fa08b906e504eb505477b0e9235'
1
+ Rails.application.config.secret_token = '7e7d63cc40339d7c0413b464087c8f33c7811b85adc81916521c2b83848407ef03b446f847b08f124f69cb55d81e2232fb718fa08b906e504eb505477b0e9235'
@@ -1,8 +1 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.session_store :cookie_store, :key => '_CampfireLogic_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 "rake db:sessions:create")
8
- # Rails.application.config.session_store :active_record_store
1
+ Rails.application.config.session_store :cookie_store, :key => '_CampfireLogic_session'
data/config/mongoid.yml CHANGED
@@ -1,25 +1,6 @@
1
1
  defaults: &defaults
2
2
  host: localhost
3
- # slaves:
4
- # - host: slave1.local
5
- # port: 27018
6
- # - host: slave2.local
7
- # port: 27019
8
- skip_version_check: true
9
-
10
- development:
11
- <<: *defaults
12
- database: campfire_logic_development
13
3
 
14
4
  test:
15
5
  <<: *defaults
16
- database: campfire_logic_test
17
-
18
- # set these environment variables on your prod server
19
- production:
20
- <<: *defaults
21
- host: <%= ENV['MONGOID_HOST'] %>
22
- port: <%= ENV['MONGOID_PORT'] %>
23
- username: <%= ENV['MONGOID_USERNAME'] %>
24
- password: <%= ENV['MONGOID_PASSWORD'] %>
25
- database: <%= ENV['MONGOID_DATABASE'] %>
6
+ database: campfire_logic_test
data/config/routes.rb CHANGED
@@ -1,17 +1,7 @@
1
1
  Rails.application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
4
-
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
8
-
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
12
- match "#{CampfireLogic.directory_slug}" => 'directory#show', :as => :directory, :via => 'get'
13
- match "#{CampfireLogic.directory_slug}/search" => 'directory#search', :as => :directory_search_root, :via => 'get'
14
- match "#{CampfireLogic.directory_slug}/search/:criteria" => 'directory#search', :as => :directory_search, :via => 'get'
2
+ get "#{CampfireLogic.directory_slug}" => 'directory#show', :as => :directory
3
+ get "#{CampfireLogic.directory_slug}/search" => 'directory#search', :as => :directory_search_root
4
+ get "#{CampfireLogic.directory_slug}/search/:criteria" => 'directory#search', :as => :directory_search
15
5
 
16
6
  class DirectoryConstraint
17
7
  def initialize; end
@@ -34,27 +24,12 @@ Rails.application.routes.draw do
34
24
  end
35
25
 
36
26
  constraints(LocaleConstraint.new) do
37
- match "#{CampfireLogic.directory_slug}/:country" => 'directory#show', :as => 'directory_show_country', :via => 'get'
38
- match "#{CampfireLogic.directory_slug}/:country/:state" => 'directory#show', :as => 'directory_show_state', :via => 'get'
39
- match "#{CampfireLogic.directory_slug}/:country/:state/:city" => 'directory#show', :as => 'directory_show_city', :via => 'get'
40
- match "#{CampfireLogic.directory_slug}/:country/:state/:city/:location" => 'directory#show', :as => 'directory_show_location', :via => 'get'
27
+ get "#{CampfireLogic.directory_slug}/:country" => 'directory#show', :as => 'directory_show_country'
28
+ get "#{CampfireLogic.directory_slug}/:country/:state" => 'directory#show', :as => 'directory_show_state'
29
+ get "#{CampfireLogic.directory_slug}/:country/:state/:city" => 'directory#show', :as => 'directory_show_city'
30
+ get "#{CampfireLogic.directory_slug}/:country/:state/:city/:location" => 'directory#show', :as => 'directory_show_location'
41
31
  end
42
32
 
43
- # Sample resource route (maps HTTP verbs to controller actions automatically):
44
- # resources :products
45
- resources :services
46
-
47
- # Sample resource route with options:
48
- # resources :products do
49
- # member do
50
- # get 'short'
51
- # post 'toggle'
52
- # end
53
- #
54
- # collection do
55
- # get 'sold'
56
- # end
57
- # end
58
33
  resources :locations do
59
34
  collection do
60
35
  get 'import'
@@ -63,34 +38,5 @@ Rails.application.routes.draw do
63
38
  end
64
39
  end
65
40
 
66
- # Sample resource route with sub-resources:
67
- # resources :products do
68
- # resources :comments, :sales
69
- # resource :seller
70
- # end
71
-
72
- # Sample resource route with more complex sub-resources
73
- # resources :products do
74
- # resources :comments
75
- # resources :sales do
76
- # get 'recent', :on => :collection
77
- # end
78
- # end
79
-
80
- # Sample resource route within a namespace:
81
- # namespace :admin do
82
- # # Directs /admin/products/* to Admin::ProductsController
83
- # # (app/controllers/admin/products_controller.rb)
84
- # resources :products
85
- # end
86
-
87
- # You can have the root of your site routed with "root"
88
- # just remember to delete public/index.html.
89
- # root :to => "directory#show", :via => 'get'
90
-
91
- # See how all your routes lay out with "rake routes"
92
-
93
- # This is a legacy wild controller route that's not recommended for RESTful applications.
94
- # Note: This route will make all actions in every controller accessible via GET requests.
95
- # match ':controller(/:action(/:id(.:format)))'
41
+ resources :services
96
42
  end
data/config.ru CHANGED
@@ -1,4 +1,2 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
1
  require ::File.expand_path('../config/environment', __FILE__)
4
- run CampfireLogic::Application
2
+ run CampfireLogic::Application
data/db/seeds.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  puts 'Importing zip codes...'
2
2
  ZipCodeImport.test
3
-
4
3
  puts 'Importing locations...'
5
- LocationImport.test
4
+ LocationImport.test
@@ -4,28 +4,48 @@
4
4
  # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
5
  # files.
6
6
 
7
- ENV["RAILS_ENV"] = "test"
8
- require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
9
-
10
- require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
11
- require 'cucumber/rails/rspec'
12
- require 'cucumber/rails/world'
13
- require 'cucumber/web/tableish'
14
- require 'capybara/rails'
15
- require 'capybara/cucumber'
16
- require 'capybara/session'
17
- require 'be_valid_asset'
18
- require 'mongoid'
19
- require 'database_cleaner'
20
- require 'database_cleaner/cucumber'
7
+ require 'cucumber/rails'
21
8
 
22
9
  # Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
23
10
  # order to ease the transition to Capybara we set the default here. If you'd
24
11
  # prefer to use XPath just remove this line and adjust any selectors in your
25
12
  # steps to use the XPath syntax.
26
13
  Capybara.default_selector = :css
27
- Capybara.save_and_open_page_path = Rails.root + 'tmp'
28
14
 
29
- # How to clean your database when transactions are turned off. See
30
- # http://github.com/bmabey/database_cleaner for more info.
15
+ # By default, any exception happening in your Rails application will bubble up
16
+ # to Cucumber so that your scenario will fail. This is a different from how
17
+ # your application behaves in the production environment, where an error page will
18
+ # be rendered instead.
19
+ #
20
+ # Sometimes we want to override this default behaviour and allow Rails to rescue
21
+ # exceptions and display an error page (just like when the app is running in production).
22
+ # Typical scenarios where you want to do this is when you test your error pages.
23
+ # There are two ways to allow Rails to rescue exceptions:
24
+ #
25
+ # 1) Tag your scenario (or feature) with @allow-rescue
26
+ #
27
+ # 2) Set the value below to true. Beware that doing this globally is not
28
+ # recommended as it will mask a lot of errors for you!
29
+ #
30
+ ActionController::Base.allow_rescue = false
31
+
32
+ # Remove/comment out the lines below if your app doesn't have a database.
33
+ # For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
31
34
  DatabaseCleaner.strategy = :truncation
35
+
36
+ # You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
37
+ # See the DatabaseCleaner documentation for details. Example:
38
+ #
39
+ # Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
40
+ # DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
41
+ # end
42
+ #
43
+ # Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
44
+ # DatabaseCleaner.strategy = :transaction
45
+ # end
46
+ #
47
+
48
+ # Possible values are :truncation and :transaction
49
+ # The :transaction strategy is faster, but might give you threading problems.
50
+ # See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
51
+ Cucumber::Rails::Database.javascript_strategy = :truncation