jackdempsey-beet 0.1.3 → 0.1.4

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/README.rdoc CHANGED
@@ -1,18 +1,8 @@
1
1
  = beet
2
2
 
3
- Beet is a simple project/app generator, with its roots and underlying infrastructure heavily influenced from Rails Templates.
3
+ Beet is a simple project generator, with its roots and underlying infrastructure heavily influenced from Rails Templates.
4
4
 
5
- Currently Beet will focus on Rails recipes, but there's no reason not to extend it to build out any sort of project.
6
- The goal is to have a variety of core level methods to allow for building of higher level concepts that make sense in whatever
7
- your project needs.
8
-
9
- Eventually I would love to see recipes for sinatra, merb, iPhone apps, etc. The sky is the limit.
10
-
11
- == Existing Recipes
12
-
13
- Beet should be compatible with existing rails templates. For instance, to use the daring.rb template, you can run:
14
-
15
- beet generate new_daring_project --recipes http://github.com/jeremymcanally/rails-templates/raw/10f5bc25e4067968dcf3e950a95538dcbc1f79ed/daring.rb
5
+ Please visit the homepage to learn more: http://jackdempsey.github.com/beet
16
6
 
17
7
  == Copyright
18
8
 
data/TODO CHANGED
@@ -4,3 +4,10 @@
4
4
  * fixup places where its obviously just rails stuff, like add_gems
5
5
  * generate command in bin/beet should have executor stuff pulled out of case, ie, it should always run
6
6
  * create a better way to mixin things from rails/whatever as needed inside Beet::Executor
7
+
8
+ * figure out if its worth it to use similar step definitions as done in Jeweler for gems that generate stuff
9
+ and want to verify things worked correctly
10
+
11
+ * write some recipes for browsercms
12
+
13
+ * write a quick htaccess generator
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/beet.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{beet}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jack Dempsey"]
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  "lib/beet/scm/svn.rb",
48
48
  "lib/beet/template_location_map.rb",
49
49
  "test/executor_test.rb",
50
- "test/file_system_shoulda_test.rb",
50
+ "test/file_system_test.rb",
51
51
  "test/test_helper.rb"
52
52
  ]
53
53
  s.homepage = %q{http://github.com/jackdempsey/beet}
@@ -57,7 +57,7 @@ Gem::Specification.new do |s|
57
57
  s.summary = %q{A gem to help with easily generating projects}
58
58
  s.test_files = [
59
59
  "test/executor_test.rb",
60
- "test/file_system_shoulda_test.rb",
60
+ "test/file_system_test.rb",
61
61
  "test/test_helper.rb"
62
62
  ]
63
63
 
data/lib/beet/executor.rb CHANGED
@@ -12,7 +12,7 @@ module Beet
12
12
  include Beet::SCM
13
13
 
14
14
  attr_reader :root, :logger, :options, :template
15
- attr_accessor :recipes, :project_name, :gems
15
+ attr_accessor :recipes, :project_name, :gems, :todo_items
16
16
 
17
17
  def initialize(project_name, options={}) # :nodoc:
18
18
  @root = calculate_project_root(project_name)
@@ -21,6 +21,7 @@ module Beet
21
21
  @gems = []
22
22
  @template = options[:template]
23
23
  @options = options
24
+ @todo_items = ''
24
25
  @recipes = []
25
26
  @project_type = options[:project_type]
26
27
  @generate = true unless options[:generate] == false
@@ -51,8 +52,11 @@ module Beet
51
52
  end
52
53
 
53
54
  run_recipes
55
+
54
56
  add_gems
55
57
 
58
+ print_todo
59
+
56
60
  if @options[:save]
57
61
  save_run
58
62
  end
@@ -73,8 +77,19 @@ module Beet
73
77
  logger.log(*args)
74
78
  end
75
79
 
80
+ def todo(string=nil, &block)
81
+ self.todo_items << (string || block.call)
82
+ end
83
+
76
84
  private
77
85
 
86
+ def print_todo
87
+ puts '#' x 30
88
+ puts "TODO Items:"
89
+ puts todo_items
90
+ puts '#' x 30
91
+ end
92
+
78
93
  def calculate_project_root(project_name)
79
94
  # if the name looks like ~/projects/foobar then thats the root
80
95
  if project_name.include?('/')
@@ -282,7 +282,7 @@ end
282
282
  }.strip
283
283
  end
284
284
 
285
- gem 'authlogic'
285
+ gem 'authlogic', :version => '~> 2.0.0'
286
286
 
287
287
  rake "gems:install", :sudo => true
288
288
  rake "db:create:all"
@@ -2,3 +2,10 @@ FileUtils.rm_r Dir.glob("public/javascripts/*.js")
2
2
 
3
3
  run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js > public/javascripts/jquery.js"
4
4
  run "curl -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js"
5
+
6
+ # Thanks to Chris Wanstrath and Doug Ramsay. The below will make it so that Rails recognizes form requests
7
+ file 'public/javascripts/application.js', <<-CODE
8
+ jQuery.ajaxSetup({
9
+ 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
10
+ });
11
+ CODE
@@ -2,14 +2,23 @@ require 'test_helper'
2
2
 
3
3
  class ExecutorShouldaTest < Test::Unit::TestCase
4
4
 
5
- should "set project root to current directory if name given is not a folder" do
5
+ should "set project root to Dir.pwd + project_name in general case" do
6
6
  executor = Beet::Executor.new('foobar')
7
- assert_equal Dir.pwd, executor.root
7
+ assert_equal Dir.pwd + "/foobar", executor.root
8
8
  end
9
9
 
10
- should "set project root to directory name if project name looks like /Users/jack/something" do
10
+ should "set project root to project name if project name looks like /Users/jack/something" do
11
11
  executor = Beet::Executor.new('/Users/jack/foobar')
12
- assert_equal '/Users/jack', executor.root
12
+ assert_equal '/Users/jack/foobar', executor.root
13
+ end
14
+
15
+ should "set project root to Dir.pwd if directory one level above is the same as the project name" do
16
+ FileUtils.mkdir_p 'foobar'
17
+ FileUtils.chdir 'foobar' do
18
+ executor = Beet::Executor.new('foobar')
19
+ assert_equal Dir.pwd, executor.root
20
+ end
21
+ FileUtils.rm_rf 'foobar'
13
22
  end
14
23
 
15
24
  end
@@ -4,7 +4,7 @@ include Beet::FileSystem
4
4
 
5
5
  # define some methods that file_system recipes expect to exist
6
6
  def root; '.'; end
7
- class FileSystemShouldaTest < Test::Unit::TestCase
7
+ class FileSystemTest < Test::Unit::TestCase
8
8
  context "#add_after" do
9
9
  setup do
10
10
  @filename = 'test.file'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jackdempsey-beet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Dempsey
@@ -64,7 +64,7 @@ files:
64
64
  - lib/beet/scm/svn.rb
65
65
  - lib/beet/template_location_map.rb
66
66
  - test/executor_test.rb
67
- - test/file_system_shoulda_test.rb
67
+ - test/file_system_test.rb
68
68
  - test/test_helper.rb
69
69
  has_rdoc: false
70
70
  homepage: http://github.com/jackdempsey/beet
@@ -94,5 +94,5 @@ specification_version: 3
94
94
  summary: A gem to help with easily generating projects
95
95
  test_files:
96
96
  - test/executor_test.rb
97
- - test/file_system_shoulda_test.rb
97
+ - test/file_system_test.rb
98
98
  - test/test_helper.rb