beet 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
data/beet.gemspec CHANGED
@@ -1,21 +1,22 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{beet}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Dempsey"]
12
- s.date = %q{2009-11-16}
12
+ s.date = %q{2009-12-14}
13
13
  s.default_executable = %q{beet}
14
14
  s.email = %q{jack.dempsey@gmail.com}
15
15
  s.executables = ["beet"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE",
18
- "README.rdoc"
18
+ "README.rdoc",
19
+ "TODO"
19
20
  ]
20
21
  s.files = [
21
22
  ".gitignore",
@@ -37,19 +38,9 @@ Gem::Specification.new do |s|
37
38
  "lib/beet/executor.rb",
38
39
  "lib/beet/file_system.rb",
39
40
  "lib/beet/gem_location_map.rb",
40
- "lib/beet/generators.rb",
41
- "lib/beet/generators/app_container.rb",
42
- "lib/beet/generators/base.rb",
43
- "lib/beet/generators/templates/app_container/%stack_name%/%stack_name%.rb.tt",
44
- "lib/beet/generators/templates/app_container/%stack_name%/Rakefile.tt",
45
- "lib/beet/generators/templates/app_container/%stack_name%/config.ru.tt",
46
- "lib/beet/generators/templates/app_container/%stack_name%/pancake_init.rb.tt",
47
- "lib/beet/generators/templates/app_container/%stack_name%/public/.empty_directory",
48
- "lib/beet/generators/templates/app_container/%stack_name%/views/root.html.haml",
49
41
  "lib/beet/interaction.rb",
50
42
  "lib/beet/logger.rb",
51
43
  "lib/beet/rails.rb",
52
- "lib/beet/recipes/pancake/app_container.rb",
53
44
  "lib/beet/recipes/passenger/vhost.rb",
54
45
  "lib/beet/recipes/rack/middleware.rb",
55
46
  "lib/beet/recipes/rails/auth/authlogic.rb",
@@ -59,6 +50,7 @@ Gem::Specification.new do |s|
59
50
  "lib/beet/recipes/rails/cms/bcms_blog.rb",
60
51
  "lib/beet/recipes/rails/cms/bcms_event.rb",
61
52
  "lib/beet/recipes/rails/css/blueprint.rb",
53
+ "lib/beet/recipes/rails/css/nifty_layout.rb",
62
54
  "lib/beet/recipes/rails/css/reset.rb",
63
55
  "lib/beet/recipes/rails/db/mysql.rb",
64
56
  "lib/beet/recipes/rails/db/postgres.rb",
@@ -98,3 +90,4 @@ Gem::Specification.new do |s|
98
90
  s.add_dependency(%q<thor>, ["~> 0.11.6"])
99
91
  end
100
92
  end
93
+
data/bin/beet CHANGED
@@ -11,9 +11,6 @@ end
11
11
  $:.unshift(File.dirname(__FILE__) + '/../lib')
12
12
  require 'beet'
13
13
  require 'pp'
14
- require 'thor/runner'
15
- require 'beet/generators'
16
-
17
14
 
18
15
  WIN32 = (RUBY_PLATFORM =~ /win32|mingw|bccwin|cygwin/) rescue nil
19
16
  SUDO = (WIN32 || ENV['SUDOLESS']) ? '': 'sudo '
@@ -27,19 +24,11 @@ class BeetRunner < Thor
27
24
  map "-d" => :display
28
25
  map "--list" => :list
29
26
  map "--display" => :display
30
- map '-x' => :execute
31
-
32
-
33
- desc "to do some shit", 'xxxx'
34
- def execute(*args)
35
- Beet::Generators::Pancake::AppContainer.start
36
- end
37
27
 
38
28
  desc 'generate [app_name]', "the main app generate method"
39
- method_options %w(recipes -r) => :string, %w(gems) => :string, %w(template -t) => :string, %w(save -s) => :string, %w(use -u) => :string,
40
- %w(project_type -p) => :string
41
- def generate(app_name)
42
- executor = Beet::Executor.new(app_name, options)
29
+ method_options %w(recipes -r) => :string, %w(gems) => :string, %w(template -t) => :string, %w(save -s) => :string, %w(use -u) => :string
30
+ def generate(app_name, project_type=:rails)
31
+ executor = Beet::Executor.new(app_name, options.merge('project_type' => project_type))
43
32
  executor.start
44
33
  end
45
34
 
@@ -112,7 +101,6 @@ class BeetRunner < Thor
112
101
  }
113
102
  end
114
103
  end
115
-
116
104
  def method_missing(*args)
117
105
  unless @activesupport_required
118
106
  require 'activesupport'
data/lib/beet/executor.rb CHANGED
@@ -24,7 +24,7 @@ module Beet
24
24
  @options = options
25
25
  @todo_items = ''
26
26
  @recipes = []
27
- @project_type = options[:project_type] || :rails
27
+ @project_type = options[:project_type]
28
28
  @generate = true unless options[:generate] == false
29
29
  @display = options[:display]
30
30
  extract_commands_from_options
@@ -76,11 +76,7 @@ module Beet
76
76
  if @display
77
77
  puts code
78
78
  else
79
- if root
80
- in_root { instance_eval(code)}
81
- else
82
- instance_eval(code)
83
- end
79
+ in_root { instance_eval(code)}
84
80
  end
85
81
  rescue LoadError, Errno::ENOENT => e
86
82
  raise "The recipe [#{recipe}] could not be loaded. Error: #{e}"
@@ -108,19 +104,15 @@ module Beet
108
104
  end
109
105
 
110
106
  def calculate_project_root(project_name)
111
- # can't assume all project types want a root. Some, like pancake, might generate the root
112
- # inside the recipe. Need to revisit this, but for now, only set when we're generating rails apps
113
- if @project_type == :rails
114
- # if the name looks like ~/projects/foobar then thats the root
115
- if project_name.include?('/')
116
- project_name
117
- # if we're running inside the app, then current dir is it
118
- elsif File.basename(Dir.pwd) == project_name
119
- Dir.pwd
120
- # assume the root is ./project_name
121
- else
122
- File.join(Dir.pwd, project_name)
123
- end
107
+ # if the name looks like ~/projects/foobar then thats the root
108
+ if project_name.include?('/')
109
+ project_name
110
+ # if we're running inside the app, then current dir is it
111
+ elsif File.basename(Dir.pwd) == project_name
112
+ Dir.pwd
113
+ # assume the root is ./project_name
114
+ else
115
+ File.join(Dir.pwd, project_name)
124
116
  end
125
117
  end
126
118
 
@@ -1,12 +1,24 @@
1
1
  gem 'warden', :version => '~> 0.5.1'
2
2
  gem 'devise', :version => '~> 0.4.1'
3
3
 
4
+ rake 'gems:install'
4
5
  generate "devise_install"
5
6
  generate "devise User"
6
7
  generate "devise_views"
7
8
 
8
9
  append_file 'config/environments/development.rb', "\nconfig.action_mailer.default_url_options = { :host => 'localhost:3000' }\n"
9
10
  append_file 'config/environment.rb', "\nDeviseMailer.sender = 'test@example.com'\n"
10
- add_after 'config/routes.rb', '# map.root :controller => "welcome"', "\nmap.root :controller => 'home'\n"
11
+ add_after 'config/routes.rb', '# map.root :controller => "welcome"', "\n map.root :controller => 'home'\n"
11
12
 
12
13
  rake "db:migrate"
14
+
15
+ file 'app/controllers/home_controller.rb' do
16
+ %{
17
+ class HomeController < ApplicationController
18
+ def index
19
+ render :text => "Welcome!"
20
+ end
21
+ end
22
+ }
23
+ end
24
+
@@ -0,0 +1,5 @@
1
+ gem 'nifty-generators'
2
+
3
+ rake 'gems:install'
4
+
5
+ generate 'nifty_layout'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Dempsey
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-16 00:00:00 -05:00
12
+ date: 2009-12-14 00:00:00 -05:00
13
13
  default_executable: beet
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -31,6 +31,7 @@ extensions: []
31
31
  extra_rdoc_files:
32
32
  - LICENSE
33
33
  - README.rdoc
34
+ - TODO
34
35
  files:
35
36
  - .gitignore
36
37
  - LICENSE
@@ -51,19 +52,9 @@ files:
51
52
  - lib/beet/executor.rb
52
53
  - lib/beet/file_system.rb
53
54
  - lib/beet/gem_location_map.rb
54
- - lib/beet/generators.rb
55
- - lib/beet/generators/app_container.rb
56
- - lib/beet/generators/base.rb
57
- - lib/beet/generators/templates/app_container/%stack_name%/%stack_name%.rb.tt
58
- - lib/beet/generators/templates/app_container/%stack_name%/Rakefile.tt
59
- - lib/beet/generators/templates/app_container/%stack_name%/config.ru.tt
60
- - lib/beet/generators/templates/app_container/%stack_name%/pancake_init.rb.tt
61
- - lib/beet/generators/templates/app_container/%stack_name%/public/.empty_directory
62
- - lib/beet/generators/templates/app_container/%stack_name%/views/root.html.haml
63
55
  - lib/beet/interaction.rb
64
56
  - lib/beet/logger.rb
65
57
  - lib/beet/rails.rb
66
- - lib/beet/recipes/pancake/app_container.rb
67
58
  - lib/beet/recipes/passenger/vhost.rb
68
59
  - lib/beet/recipes/rack/middleware.rb
69
60
  - lib/beet/recipes/rails/auth/authlogic.rb
@@ -73,6 +64,7 @@ files:
73
64
  - lib/beet/recipes/rails/cms/bcms_blog.rb
74
65
  - lib/beet/recipes/rails/cms/bcms_event.rb
75
66
  - lib/beet/recipes/rails/css/blueprint.rb
67
+ - lib/beet/recipes/rails/css/nifty_layout.rb
76
68
  - lib/beet/recipes/rails/css/reset.rb
77
69
  - lib/beet/recipes/rails/db/mysql.rb
78
70
  - lib/beet/recipes/rails/db/postgres.rb
@@ -1,8 +0,0 @@
1
- require 'thor'
2
- require 'extlib'
3
-
4
- require File.join(File.dirname(__FILE__), "generators", "base.rb")
5
-
6
- Dir[File.join(File.dirname(__FILE__), "generators", "*.rb")].each do |f|
7
- require f unless f == 'base.rb'
8
- end
@@ -1,15 +0,0 @@
1
- module Beet
2
- module Generators
3
- module Pancake
4
- class AppContainer < Base
5
- argument :stack_name, :banner => "Name of stack"
6
-
7
- desc "Generates a stack"
8
- def stack
9
- say "Creating The Stack For #{stack_name}"
10
- directory "app_container/%stack_name%", stack_name
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,12 +0,0 @@
1
- module Beet
2
- module Generators
3
- class Base < Thor::Group
4
- include Thor::Actions
5
-
6
- def self.source_root
7
- File.join(File.dirname(__FILE__), "templates")
8
- end
9
-
10
- end
11
- end
12
- end
@@ -1,8 +0,0 @@
1
- class <%= stack_name.camel_case %> < Pancake::Stacks::Short
2
- add_root(__FILE__)
3
-
4
- get "/" do
5
- render :root
6
- end
7
- end
8
-
@@ -1,40 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'pancake'
4
-
5
- require File.join(Pancake.get_root(__FILE__), "<%= stack_name %>")
6
- Pancake.root = Pancake.get_root(__FILE__)
7
- THIS_STACK = <%= stack_name.camel_case %>
8
- <%= stack_name.camel_case %>.load_rake_tasks!(:master => true)
9
-
10
- require 'spec/rake/spectask'
11
- Spec::Rake::SpecTask.new(:spec) do |spec|
12
- spec.libs << 'lib' << 'spec'
13
- spec.spec_files = FileList['spec/**/*_spec.rb']
14
- end
15
-
16
- Spec::Rake::SpecTask.new(:rcov) do |spec|
17
- spec.libs << 'lib' << 'spec'
18
- spec.pattern = 'spec/**/*_spec.rb'
19
- spec.rcov = true
20
- end
21
-
22
-
23
- task :default => :spec
24
-
25
- require 'rake/rdoctask'
26
- Rake::RDocTask.new do |rdoc|
27
- if File.exist?('VERSION.yml')
28
- config = YAML.load(File.read('VERSION.yml'))
29
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
30
- else
31
- version = ""
32
- end
33
-
34
- rdoc.rdoc_dir = 'rdoc'
35
- rdoc.title = "foo #{version}"
36
- rdoc.rdoc_files.include('README*')
37
- rdoc.rdoc_files.include('lib/**/*.rb')
38
- end
39
-
40
-
@@ -1,12 +0,0 @@
1
- require 'rubygems'
2
-
3
- require 'pancake'
4
- require ::File.join(::File.expand_path(::File.dirname(__FILE__)), "<%= stack_name %>")
5
-
6
- # get the application to run. The applicadtion in the Pancake.start block
7
- # is the master application. It will have all requests directed to it through the
8
- # pancake middleware
9
- # This should be a very minimal file, but should be used when any stand alone code needs to be included
10
- app = Pancake.start(:root => Pancake.get_root(__FILE__)){ <%= stack_name.camel_case %>.stackup(:master => true) }
11
-
12
- run app
@@ -1 +0,0 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__), "<%= stack_name %>"))
@@ -1 +0,0 @@
1
- run "pancake-gen micro #{project_name}"