playmo 0.0.14 → 0.0.17

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.
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+
3
+ <% module_namespacing do -%>
4
+ class <%= class_name %> < <%= parent_class_name.classify %>
5
+ # Constants
6
+ # Includes
7
+ # Associations
8
+ <%- attributes.select {|attr| attr.reference? }.each do |attribute| -%>
9
+ belongs_to :<%= attribute.name %>
10
+ <% end -%>
11
+ # Delegations
12
+ # Validations
13
+ # Callbacks
14
+ # InstantMethods
15
+ # ClassMethods
16
+ end
17
+ <% end -%>
@@ -0,0 +1,8 @@
1
+ <%%= heading_with_title "Editing <%= singular_table_name.camelize %>" %>
2
+
3
+ <%%= render 'form' %>
4
+
5
+ <%%= admin_area do %>
6
+ <%%= link_to_delete(@<%= singular_table_name %>, "Destroy <%= singular_table_name.camelize %>?") %>
7
+ <%%= end %>
8
+
@@ -0,0 +1,21 @@
1
+ <%%= heading_with_title "<%= singular_table_name.camelize %>" %>
2
+ <%
3
+ key = nil
4
+ key = 'title' if attributes.any? {|x| x.name == 'title'}
5
+ key = 'name' if attributes.any? {|x| x.name == 'name'}
6
+ %>
7
+ <ul id="<%= plural_table_name %>-list">
8
+ <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
9
+ <% if ['title', 'name'].include?(key) -%>
10
+ <li><%%= link_to <%= singular_table_name %>.<%= key %>, <%= singular_table_name %> %></li>
11
+ <% else -%>
12
+ <li><%%= link_to 'Show', <%= singular_table_name %> %></li>
13
+ <% end -%>
14
+ <%% end %>
15
+ </ul>
16
+
17
+ <%%= admin_area do %>
18
+ <ul>
19
+ <li><%%= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path %></li>
20
+ </ul>
21
+ <%% end %>
@@ -0,0 +1,3 @@
1
+ <%%= heading_with_title "New <%= singular_table_name.camelize %>" %>
2
+
3
+ <%%= render 'form' %>
@@ -0,0 +1,32 @@
1
+ <%
2
+ key = nil
3
+ key = 'title' if attributes.any? {|x| x.name == 'title'}
4
+ key = 'name' if attributes.any? {|x| x.name == 'name'}
5
+ -%>
6
+ <div id="<%= singular_table_name %>">
7
+ <% if ['title', 'name'].include?(key) -%>
8
+ <%%= heading_with_title @<%= singular_table_name %>.<%= key %> %>
9
+ <% else -%>
10
+ <%%= heading_with_title "<%= singular_table_name.camelize %>" %>
11
+ <% end -%>
12
+
13
+ <dl>
14
+ <% if attributes.any? -%>
15
+ <% attributes.each do |attribute| %>
16
+ <dt><%= attribute.human_name %>:</dt>
17
+ <dd><%%= @<%= singular_table_name %>.<%= attribute.name %> %></dd>
18
+ <% end -%>
19
+ <% else %>
20
+ <dt>Attribute Name:</dt>
21
+ <dd>Attribute Value</dd>
22
+ <% end %>
23
+ </dl>
24
+
25
+ </div>
26
+
27
+ <%%= admin_area do %>
28
+ <ul>
29
+ <li><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>) %></li>
30
+ <li><%%= link_to 'Back', <%= index_helper %>_path %></li>
31
+ </ul>
32
+ <%% end %>
@@ -0,0 +1,60 @@
1
+ # encoding: utf-8
2
+
3
+ <% module_namespacing do -%>
4
+ class <%= controller_class_name %>Controller < ApplicationController
5
+ before_filter :find_<%= class_name.underscore %>, :except => [:index, :new, :create]
6
+ respond_to :html
7
+
8
+ def index
9
+ @<%= plural_table_name %> = <%= orm_class.all(class_name) %>
10
+ respond_with(@<%= plural_table_name %>)
11
+ end
12
+
13
+ def show
14
+ respond_with(@<%= singular_table_name %>)
15
+ end
16
+
17
+ def new
18
+ @<%= singular_table_name %> = <%= orm_class.build(class_name) %>
19
+ respond_with(@<%= singular_table_name %>)
20
+ end
21
+
22
+ def edit
23
+ respond_with(@<%= singular_table_name %>)
24
+ end
25
+
26
+ def create
27
+ @<%= singular_table_name %> = <%= orm_class.build(class_name, "params[:#{singular_table_name}]") %>
28
+
29
+ if @<%= orm_instance.save %>
30
+ flash[:notice] = "<%= human_name %> was successfully created."
31
+ else
32
+ flash[:alert] = "<%= human_name %> has errors."
33
+ end
34
+
35
+ respond_with(@<%= singular_table_name %>)
36
+ end
37
+
38
+ def update
39
+ if @<%= orm_instance.update_attributes("params[:#{singular_table_name}]") %>
40
+ flash[:notice] = "<%= human_name %> was successfully updated."
41
+ else
42
+ flash[:alert] = "<%= human_name %> has errors."
43
+ end
44
+
45
+ respond_with(@<%= singular_table_name %>)
46
+ end
47
+
48
+ def destroy
49
+ @<%= orm_instance.destroy %>
50
+ respond_with(@<%= singular_table_name %>)
51
+ end
52
+
53
+ protected
54
+
55
+ def find_<%= class_name.underscore %>
56
+ @<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
57
+ end
58
+
59
+ end
60
+ <% end -%>
data/lib/playmo.rb CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- #require 'compass'
6
- #Compass::Frameworks.register("playmo", :path => "#{File.dirname(__FILE__)}/..")
7
-
8
5
  #if defined?(ActionController)
9
6
  # require File.join(File.dirname(__FILE__), 'app', 'helpers', 'playmo_helper')
10
7
  # ActionController::Base.helper(PlaymoHelper)
@@ -30,7 +27,15 @@ require 'rails/all'
30
27
 
31
28
  module Playmo
32
29
  extend ActiveSupport::Autoload
33
-
30
+
31
+ class Railtie < Rails::Railtie
32
+ config.app_generators do |g|
33
+ path = File::expand_path('../generators/templates', __FILE__)
34
+ g.templates.unshift path
35
+ end
36
+ end
37
+
38
+ autoload :Version
34
39
  autoload :Cli
35
40
  autoload :Event
36
41
  autoload :Options
@@ -42,9 +47,4 @@ module Playmo
42
47
  autoload :Recipe
43
48
 
44
49
  Dir["#{File.dirname(__FILE__)}/playmo/recipes/*_recipe.rb"].each { |file| require file }
45
-
46
- #autoload :Generators, 'playmo/generators/base'
47
- #class Railtie < ::Rails::Railtie
48
- # config.app_generators.scaffold_controller = :playmo_controller
49
- #end
50
50
  end
@@ -11,9 +11,10 @@ module Playmo
11
11
  gem 'capistrano'
12
12
 
13
13
  # TODO: Copy deploy.rb
14
-
15
14
  Event.events.listen(:after_install) do |event_data|
16
15
  capify!
16
+ remove_file "config/deploy.rb"
17
+ template "deploy.rb", "config/deploy.rb"
17
18
  end
18
19
  end
19
20
  end
@@ -21,7 +21,7 @@ module Playmo
21
21
  gem 'simple_form'
22
22
 
23
23
  Event.events.listen(:after_install) do |event_data|
24
- # generate
24
+ generate "simple_form:install"
25
25
  end
26
26
  end
27
27
 
@@ -29,7 +29,7 @@ module Playmo
29
29
  gem 'formtastic'
30
30
 
31
31
  Event.events.listen(:after_install) do |event_data|
32
- # generate
32
+ generate "formtastic:install"
33
33
  end
34
34
  end
35
35
 
@@ -6,6 +6,7 @@ module Playmo
6
6
  Event.events.listen(:before_exit) do |event_data|
7
7
  remove_file '.gitignore'
8
8
 
9
+ # TODO Add sphinx & dragonfly files to .gitignore
9
10
  create_file '.gitignore', <<-CONTENT.gsub(/^ {14}/, '')
10
11
  .DS_Store
11
12
  log/*.log
@@ -16,9 +17,11 @@ module Playmo
16
17
  .sass-cache/
17
18
  CONTENT
18
19
 
19
- git :init
20
- git :add => '.'
21
- git :commit => "-am 'Initial commit for #{application_name}'"
20
+ in_root do
21
+ git :init
22
+ git :add => '.'
23
+ git :commit => "-m 'Initial commit for #{application_name}'"
24
+ end
22
25
  end
23
26
  end
24
27
  end
@@ -5,7 +5,6 @@ module Playmo
5
5
  question "Please choose JS framework you prefer to install" do
6
6
  answer "JQuery (with Jquery UI)" => :install_jquery
7
7
  answer "Mootools Core (with More)" => :install_mootools
8
- answer "Prototype (with Scriptaculous and RJS)" => :install_prototype
9
8
  end
10
9
  end
11
10
 
@@ -17,7 +16,7 @@ module Playmo
17
16
 
18
17
  Event.events.listen(:after_install) do |event_data|
19
18
  gsub_file 'app/assets/javascripts/application.js', '//= require_tree .' do
20
- <<-CONTENT.gsub(/^ {16}/, '')
19
+ <<-CONTENT.gsub(/^ {14}/, '')
21
20
  //= require jquery
22
21
  //= require jquery_ui
23
22
  //= require jquery_ujs
@@ -33,7 +32,7 @@ module Playmo
33
32
 
34
33
  Event.events.listen(:after_install) do |event_data|
35
34
  gsub_file 'app/assets/javascripts/application.js', '//= require_tree .' do
36
- <<-CONTENT.gsub(/^ {16}/, '')
35
+ <<-CONTENT.gsub(/^ {14}/, '')
37
36
  //= require mootools
38
37
  //= require mootools-more
39
38
  //= require mootools_ujs
@@ -42,24 +41,6 @@ module Playmo
42
41
  end
43
42
  end
44
43
  end
45
-
46
- # See https://github.com/rails/prototype-rails for details
47
- def install_prototype
48
- gem "prototype-rails"
49
-
50
- Event.events.listen(:after_install) do |event_data|
51
- gsub_file 'app/assets/javascripts/application.js', '//= require_tree .' do
52
- <<-CONTENT.gsub(/^ {16}/, '')
53
- //= require prototype
54
- //= require prototype_ujs
55
- //= require effects
56
- //= require dragdrop
57
- //= require controls
58
- //= require_tree .
59
- CONTENT
60
- end
61
- end
62
- end
63
44
  end
64
45
  end
65
46
  end
@@ -10,8 +10,21 @@ module Playmo
10
10
  protected
11
11
 
12
12
  def install_rspec
13
- gem 'rspec'
13
+ gem 'rspec-rails'
14
14
 
15
+ Event.events.listen(:after_install) do |event_data|
16
+ generate "rspec:install"
17
+ remove_dir "test"
18
+
19
+ inject_into_file "config/application.rb", :after => "class Application < Rails::Application\n" do
20
+ <<-CONTENT.gsub(/^ {10}/, '')
21
+ config.generators do |g|
22
+ g.test_framework :rspec
23
+ end
24
+ CONTENT
25
+ end
26
+ end
27
+
15
28
  # TODO: copy helpers etc
16
29
  # TODO: factory_girl etc
17
30
  end
@@ -43,7 +43,7 @@ module ApplicationHelper
43
43
 
44
44
  # Print heading (h1 by default) and set page title
45
45
  # at the same time. Use this method in your views
46
- def heading_with_title(heading, tag=nil)
46
+ def heading_with_title(heading, tag=:h1)
47
47
  title(heading)
48
48
  heading(heading, tag)
49
49
  end
@@ -0,0 +1,120 @@
1
+ # cap deploy:setup
2
+ # cap deploy
3
+ # cap db:seed (on first deploy)
4
+ $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
5
+
6
+ require 'bundler/capistrano'
7
+
8
+ # Uncomment this if you are using Thinking Sphinx
9
+ #require 'thinking_sphinx/deploy/capistrano'
10
+
11
+ # Uncomment this if you are using Whenever
12
+ #set :whenever_command, "bundle exec whenever"
13
+ #require "whenever/capistrano"
14
+
15
+ set :application, '<%= application_name %>'
16
+ set :domain, 'user@<%= application_name %>'
17
+ set :repository, 'https://github.com/exampleuser/<%= application_name %>.git'
18
+ set :scm, :git
19
+ set :deploy_via, :remote_cache
20
+ set :branch, :master
21
+ set :scm_username, 'exampleuser'
22
+ set :scm_verbose, true
23
+ set :user, 'user'
24
+ set :use_sudo, false
25
+
26
+ ssh_options[:forward_agent] = true
27
+ default_run_options[:pty] = false
28
+
29
+ set :keep_releases, 3
30
+ set :deploy_to, "/home/#{user}/htdocs"
31
+ set :rails_env, "production"
32
+
33
+ set :unicorn_conf, "#{deploy_to}/current/config/unicorn.rb"
34
+ set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid"
35
+
36
+ role :web, domain
37
+ role :app, domain
38
+ role :db, domain, :primary => true
39
+
40
+ set(:database_username, "<%= application_name %>")
41
+ set(:development_database) { application + "_development" }
42
+ set(:test_database) { application + "_test" }
43
+ set(:production_database) { application }
44
+
45
+ namespace :deploy do
46
+ task :restart do
47
+ run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D; fi"
48
+ end
49
+
50
+ task :start do
51
+ run "bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D"
52
+ end
53
+
54
+ task :stop do
55
+ run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -QUIT `cat #{unicorn_pid}`; fi"
56
+ end
57
+
58
+ desc 'Precache assets'
59
+ task :precache_assets, :roles => :app do
60
+ run "cd #{current_release} && bundle exec rake assets:precompile RAILS_ENV=production"
61
+ end
62
+ end
63
+
64
+ namespace :db do
65
+ desc "Populates the Production Database"
66
+ task :seed do
67
+ puts "\n\n=== Populating the Production Database! ===\n\n"
68
+ run "cd #{current_path} && bundle exec rake db:seed RAILS_ENV=production"
69
+ end
70
+
71
+ desc "Create database yaml in shared path"
72
+ task :configure do
73
+ set :database_password do
74
+ Capistrano::CLI.password_prompt "Database Password: "
75
+ end
76
+
77
+ db_config = <<-EOF
78
+ base: &base
79
+ adapter: mysql2
80
+ encoding: utf8
81
+ username: #{database_username}
82
+ password: #{database_password}
83
+
84
+ development:
85
+ database: #{development_database}
86
+ <<: *base
87
+
88
+ test:
89
+ database: #{test_database}
90
+ <<: *base
91
+
92
+ production:
93
+ database: #{production_database}
94
+ <<: *base
95
+ EOF
96
+
97
+ run "mkdir -p #{shared_path}/config"
98
+ put db_config, "#{shared_path}/config/database.yml"
99
+ end
100
+
101
+ desc "Make symlink for database yaml"
102
+ task :symlink do
103
+ run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
104
+ end
105
+ end
106
+
107
+ # Uncomment this if you are using Thinking Sphinx
108
+ #after 'deploy:migrate', :roles => [:app] do
109
+ # thinking_sphinx.stop
110
+ # run "ln -nfs #{shared_path}/db/sphinx #{release_path}/db/sphinx"
111
+ # thinking_sphinx.configure
112
+ # thinking_sphinx.start
113
+ #end
114
+
115
+ before "deploy:setup", "db:configure"
116
+ before "bundle:install", "db:symlink"
117
+ after "bundle:install", "deploy:migrate"
118
+ after "deploy:migrate", "deploy:precache_assets"
119
+
120
+ require './config/boot'
@@ -0,0 +1,3 @@
1
+ module Playmo
2
+ VERSION = "0.0.17"
3
+ end
data/playmo.gemspec CHANGED
@@ -1,8 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
+ require "playmo/version"
3
4
 
4
5
  Gem::Specification.new do |s|
5
- s.version = "0.0.14"
6
+ s.version = Playmo::VERSION
6
7
  s.name = "playmo"
7
8
  s.platform = Gem::Platform::RUBY
8
9
  s.authors = ["Andrew Kozloff"]
@@ -14,7 +15,6 @@ Gem::Specification.new do |s|
14
15
 
15
16
  s.files = `git ls-files`.split("\n")
16
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
- #s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.executables = ['playmo']
19
19
  s.require_paths = ["lib"]
20
20
  s.has_rdoc = false
File without changes
metadata CHANGED
@@ -1,108 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: playmo
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.17
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 14
10
- version: 0.0.14
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Andrew Kozloff
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-12-23 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-12-25 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rails
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &72646460 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 3
31
- - 1
32
- version: "3.1"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: ruby_events
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *72646460
25
+ - !ruby/object:Gem::Dependency
26
+ name: ruby_events
27
+ requirement: &72646080 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
47
33
  type: :runtime
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: haml2slim
51
34
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *72646080
36
+ - !ruby/object:Gem::Dependency
37
+ name: haml2slim
38
+ requirement: &72645720 !ruby/object:Gem::Requirement
53
39
  none: false
54
- requirements:
55
- - - "="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- - 4
61
- - 6
40
+ requirements:
41
+ - - =
42
+ - !ruby/object:Gem::Version
62
43
  version: 0.4.6
63
44
  type: :runtime
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: haml
67
45
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *72645720
47
+ - !ruby/object:Gem::Dependency
48
+ name: haml
49
+ requirement: &72645380 !ruby/object:Gem::Requirement
69
50
  none: false
70
- requirements:
71
- - - "="
72
- - !ruby/object:Gem::Version
73
- hash: 5
74
- segments:
75
- - 3
76
- - 1
77
- - 3
51
+ requirements:
52
+ - - =
53
+ - !ruby/object:Gem::Version
78
54
  version: 3.1.3
79
55
  type: :runtime
80
- version_requirements: *id004
81
- - !ruby/object:Gem::Dependency
82
- name: rspec-rails
83
56
  prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *72645380
58
+ - !ruby/object:Gem::Dependency
59
+ name: rspec-rails
60
+ requirement: &72645000 !ruby/object:Gem::Requirement
85
61
  none: false
86
- requirements:
62
+ requirements:
87
63
  - - ~>
88
- - !ruby/object:Gem::Version
89
- hash: 9
90
- segments:
91
- - 2
92
- - 5
93
- version: "2.5"
64
+ - !ruby/object:Gem::Version
65
+ version: '2.5'
94
66
  type: :development
95
- version_requirements: *id005
67
+ prerelease: false
68
+ version_requirements: *72645000
96
69
  description:
97
- email:
70
+ email:
98
71
  - andrew@tanraya.com
99
- executables:
72
+ executables:
100
73
  - playmo
101
74
  extensions: []
102
-
103
75
  extra_rdoc_files: []
104
-
105
- files:
76
+ files:
106
77
  - .gitignore
107
78
  - .rspec
108
79
  - Gemfile
@@ -110,14 +81,16 @@ files:
110
81
  - Rakefile
111
82
  - TODO.md
112
83
  - bin/playmo
113
- - lib/generators/rails/controller_generator.rb
114
84
  - lib/generators/rails/layout_generator.rb
115
- - lib/generators/rails/scaffold_controller_generator.rb
116
- - lib/generators/rails/templates/controller.rb
117
85
  - lib/generators/rails/templates/layout.html.erb
118
86
  - lib/generators/rails/templates/layout.html.haml
119
87
  - lib/generators/rails/templates/layout.html.slim
120
- - lib/generators/rails/templates/scaffold_controller.rb
88
+ - lib/generators/templates/active_record/model/model.rb
89
+ - lib/generators/templates/erb/scaffold/edit.html.erb
90
+ - lib/generators/templates/erb/scaffold/index.html.erb
91
+ - lib/generators/templates/erb/scaffold/new.html.erb
92
+ - lib/generators/templates/erb/scaffold/show.html.erb
93
+ - lib/generators/templates/rails/scaffold_controller/controller.rb
121
94
  - lib/playmo.rb
122
95
  - lib/playmo/answer.rb
123
96
  - lib/playmo/choice.rb
@@ -166,6 +139,7 @@ files:
166
139
  - lib/playmo/recipes/templates/assets_recipe/stylesheets/partials/html5-boilerplate/_reset.css.scss
167
140
  - lib/playmo/recipes/templates/assets_recipe/stylesheets/partials/html5-boilerplate/_styles.css.scss
168
141
  - lib/playmo/recipes/templates/capistrano_recipe/.gitkeep
142
+ - lib/playmo/recipes/templates/capistrano_recipe/deploy.rb
169
143
  - lib/playmo/recipes/templates/devise_recipe/.gitkeep
170
144
  - lib/playmo/recipes/templates/forms_recipe/.gitkeep
171
145
  - lib/playmo/recipes/templates/home_controller_recipe/_sidebar.html.erb
@@ -173,43 +147,36 @@ files:
173
147
  - lib/playmo/recipes/templates/rspec_recipe/.gitkeep
174
148
  - lib/playmo/recipes/templates/rvm_recipe/.gitkeep
175
149
  - lib/playmo/silent.rb
150
+ - lib/playmo/version.rb
176
151
  - playmo.gemspec
177
152
  - spec/cookbook_spec.rb
178
153
  - spec/recipes/home_controller_recipe_spec.rb
179
154
  - spec/spec_helper.rb
180
155
  - spec/support/.gitkeep
156
+ - test/dummy/log/development.log
181
157
  homepage: https://github.com/tanraya/playmo
182
158
  licenses: []
183
-
184
159
  post_install_message:
185
160
  rdoc_options: []
186
-
187
- require_paths:
161
+ require_paths:
188
162
  - lib
189
- required_ruby_version: !ruby/object:Gem::Requirement
163
+ required_ruby_version: !ruby/object:Gem::Requirement
190
164
  none: false
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- hash: 3
195
- segments:
196
- - 0
197
- version: "0"
198
- required_rubygems_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
199
170
  none: false
200
- requirements:
201
- - - ">="
202
- - !ruby/object:Gem::Version
203
- hash: 3
204
- segments:
205
- - 0
206
- version: "0"
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
207
175
  requirements: []
208
-
209
176
  rubyforge_project: playmo
210
- rubygems_version: 1.7.2
177
+ rubygems_version: 1.8.10
211
178
  signing_key:
212
179
  specification_version: 3
213
- summary: Special kit that allows you create html5-ready Rails 3 apps quick with pre-included few useful libs in your app
180
+ summary: Special kit that allows you create html5-ready Rails 3 apps quick with pre-included
181
+ few useful libs in your app
214
182
  test_files: []
215
-
@@ -1,5 +0,0 @@
1
- require 'rails/generators/rails/controller/controller_generator'
2
-
3
- class Rails::Generators::ControllerGenerator
4
- (class << self; self; end).class_eval { source_root File.expand_path("../templates", __FILE__) }
5
- end
@@ -1,13 +0,0 @@
1
- require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'
2
-
3
- module Rails
4
- module Generators
5
- class ScaffoldControllerGenerator < ScaffoldControllerGenerator
6
- source_root File.expand_path("../templates", __FILE__)
7
-
8
- def create_controller_files
9
- template 'scaffold_controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb")
10
- end
11
- end
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- class <%= class_name %>Controller < ApplicationController
2
- respond_to :html, :json
3
-
4
- <% for action in actions -%>
5
- def <%= action %>
6
- # ...
7
- end
8
-
9
- <% end -%>
10
- end
11
-
@@ -1,56 +0,0 @@
1
- class <%= controller_class_name %>Controller < ApplicationController
2
- respond_to :html, :json
3
-
4
- <% unless options[:singleton] -%>
5
- # GET /<%= table_name %>
6
- # GET /<%= table_name %>.xml
7
- def index
8
- @<%= table_name %> = <%= orm_class.all(class_name) %>
9
- respond_with(@<%= table_name %>)
10
- end
11
- <% end -%>
12
-
13
- # GET /<%= table_name %>/1
14
- # GET /<%= table_name %>/1.xml
15
- def show
16
- @<%= file_name %> = <%= orm_class.find(class_name, "params[:id]") %>
17
- respond_with(@<%= file_name %>)
18
- end
19
-
20
- # GET /<%= table_name %>/new
21
- # GET /<%= table_name %>/new.xml
22
- def new
23
- @<%= file_name %> = <%= orm_class.build(class_name) %>
24
- respond_with(@<%= file_name %>)
25
- end
26
-
27
- # GET /<%= table_name %>/1/edit
28
- def edit
29
- @<%= file_name %> = <%= orm_class.find(class_name, "params[:id]") %>
30
- end
31
-
32
- # POST /<%= table_name %>
33
- # POST /<%= table_name %>.xml
34
- def create
35
- @<%= file_name %> = <%= orm_class.build(class_name, "params[:#{file_name}]") %>
36
- flash[:notice] = '<%= class_name %> was successfully created.' if @<%= orm_instance.save %>
37
- respond_with(@<%= file_name %>)
38
- end
39
-
40
- # PUT /<%= table_name %>/1
41
- # PUT /<%= table_name %>/1.xml
42
- def update
43
- @<%= file_name %> = <%= orm_class.find(class_name, "params[:id]") %>
44
- flash[:notice] = '<%= class_name %> was successfully updated.' if @<%= orm_instance.update_attributes("params[:#{file_name}]") %>
45
- respond_with(@<%= file_name %>)
46
- end
47
-
48
- # DELETE /<%= table_name %>/1
49
- # DELETE /<%= table_name %>/1.xml
50
- def destroy
51
- @<%= file_name %> = <%= orm_class.find(class_name, "params[:id]") %>
52
- @<%= orm_instance.destroy %>
53
- respond_with(@<%= file_name %>)
54
- end
55
- end
56
-