forge-cli 0.1.5 → 0.1.6

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 (57) hide show
  1. checksums.yaml +6 -14
  2. data/bin/cucumber +16 -0
  3. data/bin/erubis +16 -0
  4. data/bin/htmldiff +16 -0
  5. data/bin/ldiff +16 -0
  6. data/bin/rackup +16 -0
  7. data/bin/rake +16 -0
  8. data/bin/rdoc +16 -0
  9. data/bin/ri +16 -0
  10. data/bin/sprockets +16 -0
  11. data/bin/thor +16 -0
  12. data/bin/tilt +16 -0
  13. data/bin/tt +16 -0
  14. data/lib/forge-cli/modules/base/manifest.yml +18 -0
  15. data/lib/forge-cli/modules/base/routes.rb +1 -2
  16. data/lib/forge-cli/modules/events/routes.rb +6 -1
  17. data/lib/forge-cli/version.rb +1 -1
  18. data/lib/forge/Gemfile +2 -0
  19. data/lib/forge/app/controllers/events_controller.rb +11 -0
  20. data/lib/forge/app/controllers/pages_controller.rb +1 -1
  21. data/lib/forge/app/controllers/products_controller.rb +1 -1
  22. data/lib/forge/app/views/forge/dispatches/_form.html.haml +0 -13
  23. data/lib/forge/app/views/forge/events/_form.html.haml +14 -10
  24. data/lib/forge/app/views/forge/posts/_form.html.haml +2 -2
  25. data/lib/forge/app/views/forge/products/_form.html.haml +10 -4
  26. data/lib/forge/config/routes.rb +8 -3
  27. data/lib/forge/features/authentication.feature +8 -0
  28. data/lib/forge/features/step_definitions/web_steps.rb +24 -0
  29. data/lib/forge/features/support/env.rb +60 -0
  30. data/lib/forge/features/support/paths.rb +20 -0
  31. data/lib/forge/lib/assets/javascripts/forge/features/asset_uploads.js.erb +1 -1
  32. data/lib/forge/lib/generators/forge/scaffold/templates/controller_spec.rb +48 -48
  33. data/lib/forge/lib/generators/forge/scaffold_small/templates/controller_spec.rb +42 -42
  34. data/lib/forge/spec/controllers/forge/banners_controller_spec.rb +47 -47
  35. data/lib/forge/spec/controllers/forge/dispatches_controller_spec.rb +45 -45
  36. data/lib/forge/spec/controllers/forge/events_controller_spec.rb +45 -45
  37. data/lib/forge/spec/controllers/forge/galleries_controller_spec.rb +44 -44
  38. data/lib/forge/spec/controllers/forge/orders_controller_spec.rb +45 -45
  39. data/lib/forge/spec/controllers/forge/pages_controller_spec.rb +46 -46
  40. data/lib/forge/spec/controllers/forge/post_categories_controller_spec.rb +41 -41
  41. data/lib/forge/spec/controllers/forge/posts_controller_spec.rb +45 -45
  42. data/lib/forge/spec/controllers/forge/product_categories_controller_spec.rb +42 -42
  43. data/lib/forge/spec/controllers/forge/products_controller_spec.rb +47 -47
  44. data/lib/forge/spec/controllers/forge/sales_controller_spec.rb +45 -45
  45. data/lib/forge/spec/controllers/forge/subscriber_groups_controller_spec.rb +45 -45
  46. data/lib/forge/spec/controllers/forge/subscribers_controller_spec.rb +40 -40
  47. data/lib/forge/spec/controllers/forge/tax_rates_controller_spec.rb +41 -41
  48. data/lib/forge/spec/controllers/forge/users_controller_spec.rb +58 -58
  49. data/lib/forge/spec/controllers/forge/videos_controller_spec.rb +9 -9
  50. data/lib/forge/spec/models/reorderable_spec.rb +5 -5
  51. metadata +31 -21
  52. data/lib/forge/config/database.yml +0 -24
  53. data/lib/forge/config/deploy.rb +0 -53
  54. data/lib/forge/config/dispatch_daemon.yml +0 -23
  55. data/lib/forge/config/s3.yml +0 -19
  56. data/lib/forge/log/development.log +0 -2
  57. data/lib/forge/script/dispatch_daemon_fetcher +0 -28
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Y2E0ZmQxYzgyNTY4NjcxYjgyYjI4NjIwYjI1YWQxMDM4ZmY5NWM0MA==
5
- data.tar.gz: !binary |-
6
- ZmUzNTkyNDFlM2VjZjU5MTEwOGUzZmMwNWFiMjg1NTc1NTFjZTZjYQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OWRkOWQ0Y2U1MmZkMzdhMmIwMDFkODU4NzNiMTQyMGUwMDk3ZDdlOGFlMmVh
10
- YjBjMGIxMDcyZjUxMWM2NmQ5ZDFiMTU0MjFlY2JlMjdiNjdlNWJkZDFjZGRj
11
- OTE1OGIzZmE3OTU4NmUwM2U0YmYzYWU4Mzg4NTA1M2I2MzhmZWU=
12
- data.tar.gz: !binary |-
13
- MzhhMDJkOTVjYmJhMzg0N2UwM2QxODE0ZDVmNTNlYTRkOTg4OTA3NmRiNWU3
14
- ZDM2YzU1NGIyNGJkZWExODcwMDVkNDNmOWEyYWVmMDZlMjE4NmI5ZDZhNDk4
15
- ZmE2OGNiZWMwNjc2ZTBjOTI4MDRjMDVlYjBlYjZiNWMxMTc5MDE=
2
+ SHA1:
3
+ metadata.gz: 16721f143f0e604495334b8a0328f7ebbd7ba313
4
+ data.tar.gz: f934a88b7e53918deff60fdacabcf75e96e6757c
5
+ SHA512:
6
+ metadata.gz: 7d779b0f9d3ffc0594ffcbeb93a451f95d2a27299b9045de51907ea95d86c8c0aeb1d582d7b421188fdb433001cc34a679004f3f845cdba63f5ad6162d92cb9d
7
+ data.tar.gz: c5e889439dcecb7aafc4e25fae58f57b1e865512a98692b0178cc40a37b19e319a71d822769dbd741d752546b816c081993402b98db02973a14eded0d5effeda
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'cucumber' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('cucumber', 'cucumber')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'erubis' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('erubis', 'erubis')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'htmldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'htmldiff')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'ldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'ldiff')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rackup' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rack', 'rackup')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rake', 'rake')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rdoc' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rdoc', 'rdoc')
data/bin/ri ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'ri' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rdoc', 'ri')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'sprockets' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('sprockets', 'sprockets')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'thor' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('thor', 'thor')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'tilt' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('tilt', 'tilt')
data/bin/tt ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'tt' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('treetop', 'tt')
@@ -133,5 +133,23 @@ files:
133
133
  - 'db/help/pages_index.help'
134
134
  - 'db/help/pages_new.help'
135
135
 
136
+ # Tests
137
+ - 'features/support'
138
+ - 'features/step_definitions/web_steps.rb'
139
+ - 'features/authentication.feature'
140
+ - 'spec/controllers/forge/pages_controller_spec.rb'
141
+ - 'spec/controllers/forge/users_controller_spec.rb'
142
+ - 'spec/controllers/contact_controller_spec.rb'
143
+ - 'spec/controllers/sessions_controller_spec.rb'
144
+ - 'spec/integration/pages_spec.rb'
145
+ - 'spec/models/comment_spec.rb'
146
+ - 'spec/models/help_topic_spec.rb'
147
+ - 'spec/models/reorderable_spec.rb'
148
+ - 'spec/support'
149
+ - 'spec/spec_helper.rb'
150
+ - 'spec/fixtures/pages.yml'
151
+ - 'spec/fixtures/roles.yml'
152
+ - 'spec/fixtures/users.yml'
153
+
136
154
  migrations:
137
155
  - create_base_forge
@@ -3,11 +3,10 @@ resources :comments, :only => [:create, :destroy]
3
3
  namespace :forge do
4
4
  end
5
5
 
6
- devise_for :users, :controllers => { :sessions => "sessions" }
6
+ devise_for :users, :skip => [:registrations], :controllers => { :sessions => "sessions" }
7
7
  devise_scope :user do
8
8
  get "/login" => "devise/sessions#new"
9
9
  get "/logout" => "sessions#destroy"
10
- get "/register" => "devise/registrations#new"
11
10
  end
12
11
 
13
12
  match "/sitemap", :controller => 'index', :action => 'sitemap', :via => :get
@@ -1,4 +1,9 @@
1
- resources :events
1
+ resources :events, :only => [:index, :show] do
2
+ collection do
3
+ patch :preview
4
+ post :preview
5
+ end
6
+ end
2
7
  if Forge.config.events.try(:display) == :calendar
3
8
  match 'events/:year/:month' => 'events#index', :via => :get
4
9
  end
@@ -1,3 +1,3 @@
1
1
  class ForgeCLI
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
@@ -23,6 +23,8 @@ group :test do
23
23
  gem 'shoulda-matchers', '~> 2.0.0'
24
24
  gem 'spork', '~> 0.9.0.rc'
25
25
  gem 'zentest-without-autotest', '4.4.0'
26
+ gem 'cucumber-rails', :require => false
27
+ gem 'database_cleaner'
26
28
  end
27
29
 
28
30
  group :darwin do
@@ -42,4 +42,15 @@ class EventsController < ApplicationController
42
42
  format.mobile { render :template => 'mobile/event' }
43
43
  end
44
44
  end
45
+
46
+ def preview
47
+ @event = Event.new(params[:event])
48
+ # call the private methods that cause the timestamps to be set properly
49
+ @event.send(:set_starts_at)
50
+ @event.send(:set_ends_at)
51
+ unless @event.published?
52
+ flash.now[:warning] = "This event is not yet published and will not appear on your live website."
53
+ end
54
+ render :action => :show
55
+ end
45
56
  end
@@ -17,7 +17,7 @@ class PagesController < ApplicationController
17
17
  @page = Page.new(params[:page])
18
18
  @page_title = @page.seo_title.blank? ? @page.title : @page.seo_title
19
19
  unless @page.published?
20
- flash[:warning] = "This page is not yet published and will not appear on your live website."
20
+ flash.now[:warning] = "This page is not yet published and will not appear on your live website."
21
21
  end
22
22
  render :action => :show
23
23
  end
@@ -23,7 +23,7 @@ class ProductsController < ApplicationController
23
23
  end
24
24
 
25
25
  def preview
26
- flash[:notice] = "Please note that product images do not appear in previews."
26
+ flash.now[:notice] = "Please note that product images do not appear in previews."
27
27
  @product = Product.new(params[:product])
28
28
  render :action => :show
29
29
  end
@@ -1,15 +1,3 @@
1
- - content_for :scripts do
2
- :javascript
3
- $(function() {
4
- $('.preview').click(function(e) {
5
- for ( instance in CKEDITOR.instances )
6
- CKEDITOR.instances[instance].updateElement();
7
- var vals = $('form').serialize();
8
- window.open('/posts/preview?' + vals);
9
- e.preventDefault();
10
- })
11
- })
12
-
13
1
  = error_messages_for :dispatch
14
2
 
15
3
  = form_for [:forge, @dispatch] do |f|
@@ -23,5 +11,4 @@
23
11
  #item-list-bottom
24
12
  .float-right
25
13
  Everything look good?
26
- = button_link "Preview", "javascript:;", :class => "preview button"
27
14
  = button_link "Save", "javascript:;", :class => "submit button"
@@ -19,19 +19,22 @@
19
19
  }
20
20
  });
21
21
 
22
- $('.preview').click(function() {
22
+ $('.preview').click(function(e) {
23
23
  for ( instance in CKEDITOR.instances )
24
24
  CKEDITOR.instances[instance].updateElement();
25
-
26
- var form = $('form');
27
- var vals = form.serialize();
28
- var old_action = form.attr('action');
29
- form.attr({action: '/events/preview', target: '_blank'}).submit();
30
- form.attr({action: old_action, target: ''});
31
-
32
25
  e.preventDefault();
33
- })
34
- })
26
+ // store the action
27
+ var form = $(this).closest('form');
28
+ var action = $(form).attr("action");
29
+ // rewrite the target and action
30
+ $(form).attr("target", "_blank");
31
+ $(form).attr("action", "/events/preview");
32
+ $(form).submit();
33
+ // put things back the way they were
34
+ $(form).removeAttr("target");
35
+ $(form).attr("action", action);
36
+ });
37
+ });
35
38
 
36
39
  = error_messages_for :event
37
40
 
@@ -53,4 +56,5 @@
53
56
  #item-list-bottom
54
57
  .float-right
55
58
  Everything look good?
59
+ = button_link "Preview", "javascript:;", :class => "preview button"
56
60
  = button_link "Save", "javascript:;", :class => "submit button"
@@ -51,8 +51,8 @@
51
51
  = f.datetime_widget :created_at, :label => "Publication Date", :explanation => "When should this post go live?"
52
52
 
53
53
  .column.main.last
54
- = f.cktext_area :excerpt, :width => '100%', :height => '100px;', :label => "Compose & Format Your Excerpt"
55
- = f.cktext_area :content, :width => '100%', :height => '400px;', :label => "Compose & Format Your Post"
54
+ = f.cktext_area :excerpt, :ckeditor => { :width => '100%', :height => '100px;' }, :label => "Compose & Format Your Excerpt"
55
+ = f.cktext_area :content, :label => "Compose & Format Your Post"
56
56
  .spacer
57
57
 
58
58
  #seo=render :partial => "forge/shared/seo_fields", :locals => {:f => f}
@@ -2,11 +2,17 @@
2
2
  :javascript
3
3
  $(function() {
4
4
  $('.preview').click(function(e) {
5
- for ( instance in CKEDITOR.instances )
6
- CKEDITOR.instances[instance].updateElement();
7
- var vals = $('form').serialize();
8
- window.open('/products/preview?' + vals);
9
5
  e.preventDefault();
6
+ // store the action
7
+ var form = $(this).closest('form');
8
+ var action = $(form).attr("action");
9
+ // rewrite the target and action
10
+ $(form).attr("target", "_blank");
11
+ $(form).attr("action", "/products/preview");
12
+ $(form).submit();
13
+ // put things back the way they were
14
+ $(form).removeAttr("target");
15
+ $(form).attr("action", action);
10
16
  });
11
17
 
12
18
  $('#tabs').tabs();
@@ -21,7 +21,8 @@ Forge3::Application.routes.draw do
21
21
  # really need all of the standard views and actions.
22
22
  resources :products, :only => [:index, :show] do
23
23
  collection do
24
- get :preview
24
+ patch :preview
25
+ post :preview
25
26
  end
26
27
  end
27
28
 
@@ -67,8 +68,12 @@ Forge3::Application.routes.draw do
67
68
  resources :comments, :only => [:create, :destroy]
68
69
  #resources :galleries # we don't seem to have a galleries controller
69
70
 
70
- resources :events, :only => [:index, :show]
71
-
71
+ resources :events, :only => [:index, :show] do
72
+ collection do
73
+ patch :preview
74
+ post :preview
75
+ end
76
+ end
72
77
  if Forge.config.events.try(:display) == :calendar
73
78
  match 'events/:year/:month' => 'events#index', :via => :get
74
79
  end