campfire_logic 1.1.7
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.
- data/Capfile +4 -0
- data/Gemfile +29 -0
- data/Gemfile.local +27 -0
- data/README.rdoc +17 -0
- data/Rakefile +43 -0
- data/VERSION +1 -0
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/directory_controller.rb +65 -0
- data/app/controllers/locations_controller.rb +65 -0
- data/app/controllers/services_controller.rb +46 -0
- data/app/helpers/application_helper.rb +27 -0
- data/app/models/google_maps_geocoder.rb +108 -0
- data/app/models/locale.rb +204 -0
- data/app/models/location.rb +216 -0
- data/app/models/location_import.rb +48 -0
- data/app/models/service.rb +27 -0
- data/app/models/zip_code.rb +48 -0
- data/app/models/zip_code_import.rb +19 -0
- data/app/views/directory/_search_form.html.erb +4 -0
- data/app/views/directory/_show_children.html.erb +29 -0
- data/app/views/directory/_show_location.html.erb +14 -0
- data/app/views/directory/search.html.erb +31 -0
- data/app/views/directory/show.html.erb +32 -0
- data/app/views/layouts/application.html.erb +49 -0
- data/app/views/locations/_form.html.erb +69 -0
- data/app/views/locations/edit.html.erb +3 -0
- data/app/views/locations/export.erb +4 -0
- data/app/views/locations/import.html.erb +13 -0
- data/app/views/locations/index.html.erb +37 -0
- data/app/views/locations/new.html.erb +3 -0
- data/app/views/locations/show.html.erb +70 -0
- data/app/views/services/_form.html.erb +29 -0
- data/app/views/services/edit.html.erb +3 -0
- data/app/views/services/index.html.erb +25 -0
- data/app/views/services/new.html.erb +3 -0
- data/app/views/services/show.html.erb +15 -0
- data/app/views/shared/_location.html.erb +18 -0
- data/app/views/shared/_map.html.erb +2 -0
- data/app/views/shared/_nav_tabs.html.erb +5 -0
- data/autotest/discover.rb +1 -0
- data/campfire_logic.gemspec +208 -0
- data/config/application.rb +44 -0
- data/config/boot.rb +13 -0
- data/config/cucumber.yml +10 -0
- data/config/deploy.rb +40 -0
- data/config/environment.rb +6 -0
- data/config/environments/development.rb +28 -0
- data/config/environments/production.rb +49 -0
- data/config/environments/test.rb +35 -0
- data/config/initializers/campfire_logic.rb +3 -0
- data/config/initializers/metric_fu.rb +9 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/locales/en.yml +5 -0
- data/config/mongoid.yml +25 -0
- data/config/routes.rb +96 -0
- data/config.ru +4 -0
- data/db/seeds.rb +5 -0
- data/db/zip_codes.txt +42742 -0
- data/doc/google_maps_response.rb +56 -0
- data/features/admin_manages_locations.feature +10 -0
- data/features/customer_browses_directory.feature +25 -0
- data/features/customer_searches_directory.feature +29 -0
- data/features/step_definitions/directory_steps.rb +22 -0
- data/features/step_definitions/location_steps.rb +10 -0
- data/features/step_definitions/web_steps.rb +211 -0
- data/features/support/env.rb +31 -0
- data/features/support/paths.rb +33 -0
- data/features/support/selectors.rb +39 -0
- data/init.rb +1 -0
- data/lib/campfire_logic/engine.rb +7 -0
- data/lib/campfire_logic/railtie.rb +10 -0
- data/lib/campfire_logic.rb +31 -0
- data/lib/tasks/campfire_logic.rake +7 -0
- data/lib/tasks/cucumber.rake +71 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +26 -0
- data/public/favicon.ico +0 -0
- data/public/images/icons/collapsed.gif +0 -0
- data/public/images/icons/delete.png +0 -0
- data/public/images/icons/drag.png +0 -0
- data/public/images/icons/edit.png +0 -0
- data/public/images/icons/expanded.gif +0 -0
- data/public/images/icons/help_icon.png +0 -0
- data/public/images/icons/link_icon.png +0 -0
- data/public/images/icons/move.png +0 -0
- data/public/images/icons/move_white.png +0 -0
- data/public/images/icons/note.png +0 -0
- data/public/images/icons/note_white.png +0 -0
- data/public/images/icons/notification_icon_sprite.png +0 -0
- data/public/images/icons/spinner.gif +0 -0
- data/public/images/icons/view.png +0 -0
- data/public/images/icons/warning.png +0 -0
- data/public/images/icons/warning_2.png +0 -0
- data/public/images/icons/warning_box.png +0 -0
- data/public/images/icons/warning_icon.png +0 -0
- data/public/images/icons/warning_white.png +0 -0
- data/public/images/layout/arrow_asc.png +0 -0
- data/public/images/layout/arrow_desc.png +0 -0
- data/public/images/layout/black_bar.png +0 -0
- data/public/images/layout/branding.png +0 -0
- data/public/images/layout/button_bg.png +0 -0
- data/public/images/layout/content_left_bg.png +0 -0
- data/public/images/layout/content_right_bg.png +0 -0
- data/public/images/layout/footer_bg.png +0 -0
- data/public/images/layout/h2_bg.png +0 -0
- data/public/images/layout/h2_bg_for_table.png +0 -0
- data/public/images/layout/header_bg_grey.png +0 -0
- data/public/images/layout/header_bg_purple.png +0 -0
- data/public/images/layout/legend_bg.png +0 -0
- data/public/images/layout/text_field_bg.jpg +0 -0
- data/public/images/layout/text_field_error_bg.png +0 -0
- data/public/images/layout/th_bg.png +0 -0
- data/public/images/layout/th_bg_selected.png +0 -0
- data/public/images/rails.png +0 -0
- data/public/index.html +9 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +965 -0
- data/public/javascripts/dragdrop.js +974 -0
- data/public/javascripts/effects.js +1123 -0
- data/public/javascripts/prototype.js +6001 -0
- data/public/javascripts/rails.js +175 -0
- data/public/robots.txt +6 -0
- data/public/sample-locations.xls +1 -0
- data/public/stylesheets/.gitkeep +0 -0
- data/public/stylesheets/application.css +682 -0
- data/public/stylesheets/core.css +1147 -0
- data/public/stylesheets/core_ie.css +52 -0
- data/public/stylesheets/csshover3.htc +14 -0
- data/script/cucumber +10 -0
- data/script/rails +6 -0
- data/spec/controllers/directory_controller_spec.rb +11 -0
- data/spec/controllers/services_controller_spec.rb +62 -0
- data/spec/models/google_maps_geocoder_spec.rb +62 -0
- data/spec/models/locale_spec.rb +64 -0
- data/spec/models/location_import_spec.rb +41 -0
- data/spec/models/location_spec.rb +195 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/test-locations.xls +1 -0
- metadata +361 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<%- set_title "Location: #{@location.name}" -%>
|
|
2
|
+
|
|
3
|
+
<fieldset class="form_container">
|
|
4
|
+
<%= legend_tag "About This Location" -%>
|
|
5
|
+
|
|
6
|
+
<div class="form_column">
|
|
7
|
+
<fieldset>
|
|
8
|
+
<label>Name:</label><br />
|
|
9
|
+
<div class="faux_field"><%=h @location.name -%></div>
|
|
10
|
+
</fieldset>
|
|
11
|
+
<fieldset>
|
|
12
|
+
<label>Status:</label><br />
|
|
13
|
+
<div class="faux_field"><%=h @location.active? ? "Active" : "Inactive" -%></div>
|
|
14
|
+
</fieldset>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="form_column">
|
|
18
|
+
<div id="map_canvas" style="border: solid black 1px; width: 100%; height: 200px"></div>
|
|
19
|
+
</div>
|
|
20
|
+
</fieldset>
|
|
21
|
+
|
|
22
|
+
<fieldset class="form_container">
|
|
23
|
+
<%= legend_tag "Address" -%>
|
|
24
|
+
<div class="form_column">
|
|
25
|
+
<fieldset>
|
|
26
|
+
<label>Address 1:</label><br />
|
|
27
|
+
<div class="faux_field"><%=h @location.address1 -%></div>
|
|
28
|
+
</fieldset>
|
|
29
|
+
<fieldset>
|
|
30
|
+
<label>Address 2:</label><br />
|
|
31
|
+
<div class="faux_field"><%=h @location.address2 -%></div>
|
|
32
|
+
</fieldset>
|
|
33
|
+
<fieldset>
|
|
34
|
+
<label>City:</label><br />
|
|
35
|
+
<div class="faux_field"><%=h @location.city -%></div>
|
|
36
|
+
</fieldset>
|
|
37
|
+
<fieldset>
|
|
38
|
+
<label>State:</label><br />
|
|
39
|
+
<div class="faux_field"><%=h @location.state -%></div>
|
|
40
|
+
</fieldset>
|
|
41
|
+
<fieldset>
|
|
42
|
+
<label>Zip:</label><br />
|
|
43
|
+
<div class="faux_field"><%=h @location.zip -%></div>
|
|
44
|
+
</fieldset>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="form_column">
|
|
48
|
+
<fieldset>
|
|
49
|
+
<label>Phone:</label><br />
|
|
50
|
+
<div class="faux_field"><%=h @location.phone -%></div>
|
|
51
|
+
</fieldset>
|
|
52
|
+
<fieldset>
|
|
53
|
+
<label>Fax:</label><br />
|
|
54
|
+
<div class="faux_field"><%=h @location.fax -%></div>
|
|
55
|
+
</fieldset>
|
|
56
|
+
<fieldset>
|
|
57
|
+
<label>Email:</label><br />
|
|
58
|
+
<div class="faux_field"><%=h @location.email -%></div>
|
|
59
|
+
</fieldset>
|
|
60
|
+
</div>
|
|
61
|
+
</fieldset>
|
|
62
|
+
|
|
63
|
+
<%= link_to 'Edit', edit_location_path(@location), :class => 'button' -%>
|
|
64
|
+
<%= link_to 'Back to Locations', locations_path, :class => 'button' -%>
|
|
65
|
+
|
|
66
|
+
<%= render :partial => 'shared/map', :locals => {:place => @location.locale} -%>
|
|
67
|
+
|
|
68
|
+
<script type="text/javascript">
|
|
69
|
+
initializeMap();
|
|
70
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<%= form_for @service do |f| -%>
|
|
2
|
+
<%- if @service.errors.any? -%>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2>Please correct the following errors:</h2>
|
|
5
|
+
<%- @service.errors.to_a.in_groups(2, false).each do |group| -%>
|
|
6
|
+
<ul>
|
|
7
|
+
<%- group.each do |msg| -%>
|
|
8
|
+
<li><%= msg -%></li>
|
|
9
|
+
<%- end -%>
|
|
10
|
+
</ul>
|
|
11
|
+
<%- end -%>
|
|
12
|
+
<br style="clear: both;" />
|
|
13
|
+
</div>
|
|
14
|
+
<br style="clear: both;" />
|
|
15
|
+
<%- end -%>
|
|
16
|
+
|
|
17
|
+
<fieldset class="form_container">
|
|
18
|
+
<%= legend_tag 'About This Service' -%>
|
|
19
|
+
|
|
20
|
+
<div class="form_column">
|
|
21
|
+
<%= f.text_field :name -%>
|
|
22
|
+
<%= f.text_area :description -%>
|
|
23
|
+
</div>
|
|
24
|
+
</fieldset>
|
|
25
|
+
|
|
26
|
+
<%= f.submit 'Save', :class => 'button' -%>
|
|
27
|
+
<%= link_to 'Cancel', services_path, :class => 'button' -%>
|
|
28
|
+
<br style="clear: both;" />
|
|
29
|
+
<%- end -%>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<%- set_title 'Services' -%>
|
|
2
|
+
|
|
3
|
+
<%- if @services.empty? -%>
|
|
4
|
+
<p><em>No services have been created yet.</em></p>
|
|
5
|
+
<%- else -%>
|
|
6
|
+
<table class="standard">
|
|
7
|
+
<tr>
|
|
8
|
+
<th><%= sort_link('services', 'name', params) -%></th>
|
|
9
|
+
<th><%= sort_link('services', 'description', params) -%></th>
|
|
10
|
+
<th> </th>
|
|
11
|
+
</tr>
|
|
12
|
+
|
|
13
|
+
<%- @services.each do |service| -%>
|
|
14
|
+
<tr class="<%= cycle('odd', 'even') -%>">
|
|
15
|
+
<td><%= service.name -%></td>
|
|
16
|
+
<td><%= service.description -%></td>
|
|
17
|
+
<td class="crud_links"><%= crud_links(service, [:show, :edit, :destroy]) -%></td>
|
|
18
|
+
</tr>
|
|
19
|
+
<%- end -%>
|
|
20
|
+
</table>
|
|
21
|
+
<%- end -%>
|
|
22
|
+
|
|
23
|
+
<br />
|
|
24
|
+
|
|
25
|
+
<%= link_to 'New Service', new_service_path, :class => 'button' -%>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<%- set_title 'Service Details' -%>
|
|
2
|
+
|
|
3
|
+
<fieldset class="form_container">
|
|
4
|
+
<%= legend_tag 'About This Service' -%>
|
|
5
|
+
|
|
6
|
+
<div class="form_column">
|
|
7
|
+
<%= faux_field 'Name', @service.name -%>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="form_column">
|
|
10
|
+
<%= faux_field 'Description', @service.description -%>
|
|
11
|
+
</div>
|
|
12
|
+
</fieldset>
|
|
13
|
+
|
|
14
|
+
<%= link_to 'Edit', edit_service_path(@service), :class => 'button' -%>
|
|
15
|
+
<%= link_to 'Back', services_path, :class => 'button' -%>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="vcard">
|
|
2
|
+
<div class="fn org"><%= link_to @location.name, @location.locale.to_url -%></div>
|
|
3
|
+
<p class="adr">
|
|
4
|
+
<span class="street-address"><%= h @location.street_address('<br />') -%></span><br />
|
|
5
|
+
<span class="locality"><%= h @location.city -%></span>,
|
|
6
|
+
<span class="region"><%= h @location.state.upcase -%></span>
|
|
7
|
+
<span class="postal-code"><%= h @location.zip -%></span><br />
|
|
8
|
+
<span class="tel">Phone
|
|
9
|
+
<span class="type" style="display: none;">Work</span>
|
|
10
|
+
<span class="value"><%= h @location.phone -%></span>
|
|
11
|
+
</span><br />
|
|
12
|
+
<%- if @location.fax && @location.fax.size > 3 -%>
|
|
13
|
+
<span class="tel">Fax
|
|
14
|
+
<span class="value"><%= h @location.fax -%></span>
|
|
15
|
+
</span><br />
|
|
16
|
+
<%- end -%>
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<%# requires local variables: locations AND place; Adapted from http://code.google.com/apis/maps/documentation/javascript/examples/icon-complex.html -%><script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script><script type="text/javascript"> //<![CDATA[
|
|
2
|
+
var directionsDisplay = new google.maps.DirectionsRenderer(); var directionsService = new google.maps.DirectionsService(); var locations = [ <%- if place && place.location? && place.geocoded? -%> <%= raw "['#{h(escape_javascript place.location.name)}', #{place.lat_lng[0]}, #{place.lat_lng[1]}, '#{h(escape_javascript place.location.name)}<br />#{h(escape_javascript place.location.address1)}<br />#{h(escape_javascript place.location.city)}, #{h(escape_javascript place.location.state)} #{h(escape_javascript place.location.zip)}<br /><br />Directions: <a href=\"javascript:showDirectionsTo(0)\">To here<\/a> / <a href=\"javascript:showDirectionsFrom(0)\">From here<\/a>']" -%> <%- else -%> <%= raw locations.select{ |l| l.geocoded? }.inject([]) { |a, l| i = a.size; a << "['#{h(escape_javascript l.name)}', #{l.lat_lng[0]}, #{l.lat_lng[1]}, '#{link_to h(escape_javascript l.name), l.locale.to_url}<br />#{h(escape_javascript l.address1)}<br />#{h(escape_javascript l.city)}, #{h(escape_javascript l.state)} #{h(escape_javascript l.zip)}<br /><br />Directions: <a href=\"javascript:showDirectionsTo(#{i})\">To here<\/a> / <a href=\"javascript:showDirectionsFrom(#{i})\">From here<\/a>']"; a } * ",\r" -%> <%- end -%> ]; var map; var markers = []; var openWindow; function initializeMap() { var myOptions = { zoom: <%= place && place.zoom_level || 4 -%>, <%- if place && place.geocoded? -%> center: new google.maps.LatLng(<%= place.lat_lng[0] -%>, <%= place.lat_lng[1] -%>), <%- elsif place && place.parent && place.parent.geocoded? -%> center: new google.maps.LatLng(<%= place.parent.lat_lng[0] -%>, <%= place.parent.lat_lng[1] -%>), <%- else -%> center: new google.maps.LatLng(37.09024, -95.712891), <%- end -%> mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); directionsDisplay.setMap(map); directionsDisplay.setPanel($('directions_panel')); for (var i = 0; i < locations.length; i++) { markers[i] = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map }); attachBalloon(i, locations[i][3]); } } function attachBalloon(i, content) { google.maps.event.addListener(markers[i], 'click', function() { if (openWindow != undefined) { openWindow.close(); } openWindow = new google.maps.InfoWindow( {content: '<div class=\"map-balloon\" id=\"open-balloon\">' + content + '</div>'} ); openWindow.open(map, markers[i]); $('open-balloon').parentNode.style.overflow = 'visible'; }); } function calcRoute(start, end) { var request = { origin: start, destination: end, travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); openWindow.close(); } }); } function showAddress(i) { $('open-balloon').innerHTML = locations[i][3]; } function showDirectionsFrom(i) { $('open-balloon').innerHTML = 'Directions to:<form action="javascript:calcRoute(\'' + locations[i][1] + ' ' + locations[i][2] + '\', $(\'directions-input\').value)"><input type="text" maxlength="40" name="directions-input" id="directions-input" style="width: 100%;" /><input value="Go" type="submit" /><input value="Cancel" type="button" onclick="showAddress(' + i + ')" /></form>'; } function showDirectionsTo(i) { $('open-balloon').innerHTML = 'Directions from:<form action="javascript:calcRoute($(\'directions-input\').value, \'' + locations[i][1] + ' ' + locations[i][2] + '\')"><input type="text" maxlength="40" name="directions-input" id="directions-input" style="width: 100%;" /><input value="Go" type="submit" /><input value="Cancel" type="button" onclick="showAddress(' + i + ')" /></form>'; } //]]></script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Autotest.add_discovery { 'rspec2' }
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Generated by jeweler
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
+
# -*- encoding: utf-8 -*-
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |s|
|
|
7
|
+
s.name = %q{campfire_logic}
|
|
8
|
+
s.version = "1.1.7"
|
|
9
|
+
|
|
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}
|
|
15
|
+
s.extra_rdoc_files = [
|
|
16
|
+
"README.rdoc"
|
|
17
|
+
]
|
|
18
|
+
s.files = [
|
|
19
|
+
"Capfile",
|
|
20
|
+
"Gemfile",
|
|
21
|
+
"Gemfile.local",
|
|
22
|
+
"README.rdoc",
|
|
23
|
+
"Rakefile",
|
|
24
|
+
"VERSION",
|
|
25
|
+
"app/controllers/application_controller.rb",
|
|
26
|
+
"app/controllers/directory_controller.rb",
|
|
27
|
+
"app/controllers/locations_controller.rb",
|
|
28
|
+
"app/controllers/services_controller.rb",
|
|
29
|
+
"app/helpers/application_helper.rb",
|
|
30
|
+
"app/models/google_maps_geocoder.rb",
|
|
31
|
+
"app/models/locale.rb",
|
|
32
|
+
"app/models/location.rb",
|
|
33
|
+
"app/models/location_import.rb",
|
|
34
|
+
"app/models/service.rb",
|
|
35
|
+
"app/models/zip_code.rb",
|
|
36
|
+
"app/models/zip_code_import.rb",
|
|
37
|
+
"app/views/directory/_search_form.html.erb",
|
|
38
|
+
"app/views/directory/_show_children.html.erb",
|
|
39
|
+
"app/views/directory/_show_location.html.erb",
|
|
40
|
+
"app/views/directory/search.html.erb",
|
|
41
|
+
"app/views/directory/show.html.erb",
|
|
42
|
+
"app/views/layouts/application.html.erb",
|
|
43
|
+
"app/views/locations/_form.html.erb",
|
|
44
|
+
"app/views/locations/edit.html.erb",
|
|
45
|
+
"app/views/locations/export.erb",
|
|
46
|
+
"app/views/locations/import.html.erb",
|
|
47
|
+
"app/views/locations/index.html.erb",
|
|
48
|
+
"app/views/locations/new.html.erb",
|
|
49
|
+
"app/views/locations/show.html.erb",
|
|
50
|
+
"app/views/services/_form.html.erb",
|
|
51
|
+
"app/views/services/edit.html.erb",
|
|
52
|
+
"app/views/services/index.html.erb",
|
|
53
|
+
"app/views/services/new.html.erb",
|
|
54
|
+
"app/views/services/show.html.erb",
|
|
55
|
+
"app/views/shared/_location.html.erb",
|
|
56
|
+
"app/views/shared/_map.html.erb",
|
|
57
|
+
"app/views/shared/_nav_tabs.html.erb",
|
|
58
|
+
"autotest/discover.rb",
|
|
59
|
+
"campfire_logic.gemspec",
|
|
60
|
+
"config.ru",
|
|
61
|
+
"config/application.rb",
|
|
62
|
+
"config/boot.rb",
|
|
63
|
+
"config/cucumber.yml",
|
|
64
|
+
"config/deploy.rb",
|
|
65
|
+
"config/environment.rb",
|
|
66
|
+
"config/environments/development.rb",
|
|
67
|
+
"config/environments/production.rb",
|
|
68
|
+
"config/environments/test.rb",
|
|
69
|
+
"config/initializers/campfire_logic.rb",
|
|
70
|
+
"config/initializers/metric_fu.rb",
|
|
71
|
+
"config/initializers/secret_token.rb",
|
|
72
|
+
"config/initializers/session_store.rb",
|
|
73
|
+
"config/locales/en.yml",
|
|
74
|
+
"config/mongoid.yml",
|
|
75
|
+
"config/routes.rb",
|
|
76
|
+
"db/seeds.rb",
|
|
77
|
+
"db/zip_codes.txt",
|
|
78
|
+
"doc/google_maps_response.rb",
|
|
79
|
+
"features/admin_manages_locations.feature",
|
|
80
|
+
"features/customer_browses_directory.feature",
|
|
81
|
+
"features/customer_searches_directory.feature",
|
|
82
|
+
"features/step_definitions/directory_steps.rb",
|
|
83
|
+
"features/step_definitions/location_steps.rb",
|
|
84
|
+
"features/step_definitions/web_steps.rb",
|
|
85
|
+
"features/support/env.rb",
|
|
86
|
+
"features/support/paths.rb",
|
|
87
|
+
"features/support/selectors.rb",
|
|
88
|
+
"init.rb",
|
|
89
|
+
"lib/campfire_logic.rb",
|
|
90
|
+
"lib/campfire_logic/engine.rb",
|
|
91
|
+
"lib/campfire_logic/railtie.rb",
|
|
92
|
+
"lib/tasks/campfire_logic.rake",
|
|
93
|
+
"lib/tasks/cucumber.rake",
|
|
94
|
+
"public/404.html",
|
|
95
|
+
"public/422.html",
|
|
96
|
+
"public/500.html",
|
|
97
|
+
"public/favicon.ico",
|
|
98
|
+
"public/images/icons/collapsed.gif",
|
|
99
|
+
"public/images/icons/delete.png",
|
|
100
|
+
"public/images/icons/drag.png",
|
|
101
|
+
"public/images/icons/edit.png",
|
|
102
|
+
"public/images/icons/expanded.gif",
|
|
103
|
+
"public/images/icons/help_icon.png",
|
|
104
|
+
"public/images/icons/link_icon.png",
|
|
105
|
+
"public/images/icons/move.png",
|
|
106
|
+
"public/images/icons/move_white.png",
|
|
107
|
+
"public/images/icons/note.png",
|
|
108
|
+
"public/images/icons/note_white.png",
|
|
109
|
+
"public/images/icons/notification_icon_sprite.png",
|
|
110
|
+
"public/images/icons/spinner.gif",
|
|
111
|
+
"public/images/icons/view.png",
|
|
112
|
+
"public/images/icons/warning.png",
|
|
113
|
+
"public/images/icons/warning_2.png",
|
|
114
|
+
"public/images/icons/warning_box.png",
|
|
115
|
+
"public/images/icons/warning_icon.png",
|
|
116
|
+
"public/images/icons/warning_white.png",
|
|
117
|
+
"public/images/layout/arrow_asc.png",
|
|
118
|
+
"public/images/layout/arrow_desc.png",
|
|
119
|
+
"public/images/layout/black_bar.png",
|
|
120
|
+
"public/images/layout/branding.png",
|
|
121
|
+
"public/images/layout/button_bg.png",
|
|
122
|
+
"public/images/layout/content_left_bg.png",
|
|
123
|
+
"public/images/layout/content_right_bg.png",
|
|
124
|
+
"public/images/layout/footer_bg.png",
|
|
125
|
+
"public/images/layout/h2_bg.png",
|
|
126
|
+
"public/images/layout/h2_bg_for_table.png",
|
|
127
|
+
"public/images/layout/header_bg_grey.png",
|
|
128
|
+
"public/images/layout/header_bg_purple.png",
|
|
129
|
+
"public/images/layout/legend_bg.png",
|
|
130
|
+
"public/images/layout/text_field_bg.jpg",
|
|
131
|
+
"public/images/layout/text_field_error_bg.png",
|
|
132
|
+
"public/images/layout/th_bg.png",
|
|
133
|
+
"public/images/layout/th_bg_selected.png",
|
|
134
|
+
"public/images/rails.png",
|
|
135
|
+
"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
|
+
"public/sample-locations.xls",
|
|
144
|
+
"public/stylesheets/.gitkeep",
|
|
145
|
+
"public/stylesheets/application.css",
|
|
146
|
+
"public/stylesheets/core.css",
|
|
147
|
+
"public/stylesheets/core_ie.css",
|
|
148
|
+
"public/stylesheets/csshover3.htc",
|
|
149
|
+
"script/cucumber",
|
|
150
|
+
"script/rails",
|
|
151
|
+
"spec/controllers/directory_controller_spec.rb",
|
|
152
|
+
"spec/controllers/services_controller_spec.rb",
|
|
153
|
+
"spec/models/google_maps_geocoder_spec.rb",
|
|
154
|
+
"spec/models/locale_spec.rb",
|
|
155
|
+
"spec/models/location_import_spec.rb",
|
|
156
|
+
"spec/models/location_spec.rb",
|
|
157
|
+
"spec/rcov.opts",
|
|
158
|
+
"spec/spec_helper.rb",
|
|
159
|
+
"spec/test-locations.xls"
|
|
160
|
+
]
|
|
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}
|
|
165
|
+
|
|
166
|
+
if s.respond_to? :specification_version then
|
|
167
|
+
s.specification_version = 3
|
|
168
|
+
|
|
169
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
170
|
+
s.add_runtime_dependency(%q<bson_ext>, [">= 0"])
|
|
171
|
+
s.add_runtime_dependency(%q<fastercsv>, [">= 0"])
|
|
172
|
+
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"])
|
|
175
|
+
s.add_runtime_dependency(%q<scaffold_logic>, [">= 0"])
|
|
176
|
+
s.add_runtime_dependency(%q<stateflow>, [">= 0"])
|
|
177
|
+
s.add_runtime_dependency(%q<stringex>, [">= 0"])
|
|
178
|
+
s.add_runtime_dependency(%q<SystemTimer>, [">= 0"])
|
|
179
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
|
180
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
|
181
|
+
else
|
|
182
|
+
s.add_dependency(%q<bson_ext>, [">= 0"])
|
|
183
|
+
s.add_dependency(%q<fastercsv>, [">= 0"])
|
|
184
|
+
s.add_dependency(%q<mongoid-tree>, [">= 0"])
|
|
185
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
|
186
|
+
s.add_dependency(%q<rails>, [">= 3.0"])
|
|
187
|
+
s.add_dependency(%q<scaffold_logic>, [">= 0"])
|
|
188
|
+
s.add_dependency(%q<stateflow>, [">= 0"])
|
|
189
|
+
s.add_dependency(%q<stringex>, [">= 0"])
|
|
190
|
+
s.add_dependency(%q<SystemTimer>, [">= 0"])
|
|
191
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
|
192
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
|
193
|
+
end
|
|
194
|
+
else
|
|
195
|
+
s.add_dependency(%q<bson_ext>, [">= 0"])
|
|
196
|
+
s.add_dependency(%q<fastercsv>, [">= 0"])
|
|
197
|
+
s.add_dependency(%q<mongoid-tree>, [">= 0"])
|
|
198
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
|
199
|
+
s.add_dependency(%q<rails>, [">= 3.0"])
|
|
200
|
+
s.add_dependency(%q<scaffold_logic>, [">= 0"])
|
|
201
|
+
s.add_dependency(%q<stateflow>, [">= 0"])
|
|
202
|
+
s.add_dependency(%q<stringex>, [">= 0"])
|
|
203
|
+
s.add_dependency(%q<SystemTimer>, [">= 0"])
|
|
204
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
|
205
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'action_controller/railtie'
|
|
4
|
+
require 'action_mailer/railtie'
|
|
5
|
+
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
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
|
10
|
+
|
|
11
|
+
module CampfireLogic
|
|
12
|
+
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.
|
|
42
|
+
config.filter_parameters += [:password]
|
|
43
|
+
end
|
|
44
|
+
end
|
data/config/boot.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
|
|
3
|
+
# Set up gems listed in the Gemfile.
|
|
4
|
+
gemfile = File.expand_path('../../Gemfile', __FILE__)
|
|
5
|
+
begin
|
|
6
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
|
7
|
+
require 'bundler'
|
|
8
|
+
Bundler.setup
|
|
9
|
+
rescue Bundler::GemNotFound => e
|
|
10
|
+
STDERR.puts e.message
|
|
11
|
+
STDERR.puts "Try running `bundle install`."
|
|
12
|
+
exit!
|
|
13
|
+
end if File.exist?(gemfile)
|
data/config/cucumber.yml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<%
|
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
|
5
|
+
int_opts = "#{std_opts} -o tmp/feature_results.txt"
|
|
6
|
+
%>
|
|
7
|
+
default: <%= std_opts %> features
|
|
8
|
+
wip: --tags @wip:3 --wip features
|
|
9
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
|
10
|
+
integration: <%= int_opts %> features
|
data/config/deploy.rb
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Deploy this gem to the gem server.
|
|
2
|
+
#
|
|
3
|
+
# Usage for a gem already on the gem server:
|
|
4
|
+
#
|
|
5
|
+
# cap deploy
|
|
6
|
+
#
|
|
7
|
+
# For a new gem:
|
|
8
|
+
#
|
|
9
|
+
# cap deploy:new
|
|
10
|
+
|
|
11
|
+
# Global Variables =================================================================================
|
|
12
|
+
default_run_options[:pty] = true
|
|
13
|
+
role :app, 'jose.seologic.com'
|
|
14
|
+
set :deploy_to, '/home/containers/rails/system/campfire_logic'
|
|
15
|
+
set :repository, 'git@github.com:ivanoblomov/campfire_logic.git'
|
|
16
|
+
set :scm, :git
|
|
17
|
+
set :use_sudo, false
|
|
18
|
+
set :user, 'cnewton'
|
|
19
|
+
|
|
20
|
+
namespace :deploy do
|
|
21
|
+
desc "Clone a new gem's repository on the gem server."
|
|
22
|
+
task :new do
|
|
23
|
+
run "git clone -q #{repository} #{deploy_to}"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
task :install do
|
|
27
|
+
run "cd #{deploy_to}; rm -f Gemfile.lock; sudo bundle; sudo rake install"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# disable default behavior
|
|
31
|
+
task :restart do
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
task :update do
|
|
35
|
+
run "cd #{deploy_to}; git pull"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
after 'deploy', 'deploy:install'
|
|
40
|
+
after 'deploy:new', 'deploy:install'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
CampfireLogic::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/environment.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 webserver 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_view.debug_rjs = true
|
|
15
|
+
config.action_controller.perform_caching = false
|
|
16
|
+
|
|
17
|
+
# Don't care if the mailer can't send
|
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
|
19
|
+
|
|
20
|
+
# Print deprecation notices to the Rails logger
|
|
21
|
+
config.active_support.deprecation = :log
|
|
22
|
+
|
|
23
|
+
# Only use best-standards-support built into browsers
|
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
|
25
|
+
|
|
26
|
+
# Custom settings
|
|
27
|
+
config.feature_results_path = "#{Rails.root}/tmp/feature_results.txt"
|
|
28
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
CampfireLogic::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
3
|
+
|
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
|
5
|
+
# Code is not reloaded between requests
|
|
6
|
+
config.cache_classes = true
|
|
7
|
+
|
|
8
|
+
# Full error reports are disabled and caching is turned on
|
|
9
|
+
config.consider_all_requests_local = false
|
|
10
|
+
config.action_controller.perform_caching = true
|
|
11
|
+
|
|
12
|
+
# Specifies the header that your server uses for sending files
|
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
|
14
|
+
|
|
15
|
+
# For nginx:
|
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
|
17
|
+
|
|
18
|
+
# If you have no front-end server that supports something like X-Sendfile,
|
|
19
|
+
# just comment this out and Rails will serve the files
|
|
20
|
+
|
|
21
|
+
# See everything in the log (default is :info)
|
|
22
|
+
# config.log_level = :debug
|
|
23
|
+
|
|
24
|
+
# Use a different logger for distributed setups
|
|
25
|
+
# config.logger = SyslogLogger.new
|
|
26
|
+
|
|
27
|
+
# Use a different cache store in production
|
|
28
|
+
# config.cache_store = :mem_cache_store
|
|
29
|
+
|
|
30
|
+
# Disable Rails's static asset server
|
|
31
|
+
# In production, Apache or nginx will already do this
|
|
32
|
+
config.serve_static_assets = false
|
|
33
|
+
|
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
|
36
|
+
|
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
39
|
+
|
|
40
|
+
# Enable threaded mode
|
|
41
|
+
# config.threadsafe!
|
|
42
|
+
|
|
43
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
44
|
+
# the I18n.default_locale when a translation can not be found)
|
|
45
|
+
config.i18n.fallbacks = true
|
|
46
|
+
|
|
47
|
+
# Send deprecation notices to registered listeners
|
|
48
|
+
config.active_support.deprecation = :notify
|
|
49
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
config.cache_classes = true
|
|
9
|
+
|
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
|
11
|
+
config.whiny_nils = true
|
|
12
|
+
|
|
13
|
+
# Show full error reports and disable caching
|
|
14
|
+
config.consider_all_requests_local = true
|
|
15
|
+
config.action_controller.perform_caching = false
|
|
16
|
+
|
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
|
18
|
+
config.action_dispatch.show_exceptions = false
|
|
19
|
+
|
|
20
|
+
# Disable request forgery protection in test environment
|
|
21
|
+
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
|
+
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
|
+
config.active_support.deprecation = :stderr
|
|
35
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
if Rails.env.test?
|
|
2
|
+
require 'metric_fu'
|
|
3
|
+
MetricFu::Configuration.run do |config|
|
|
4
|
+
config.metrics = [:churn, :saikuro, :stats, :flog, :flay]
|
|
5
|
+
config.graphs = [:flog, :flay, :stats]
|
|
6
|
+
config.rcov[:test_files] = ['spec/**/*_spec.rb']
|
|
7
|
+
config.rcov[:rcov_opts] << '-Ispec' # Needed to find spec_helper
|
|
8
|
+
end
|
|
9
|
+
end
|