ore 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/.gitignore +10 -0
  2. data/ChangeLog.md +70 -7
  3. data/LICENSE.txt +1 -1
  4. data/README.md +93 -88
  5. data/Rakefile +5 -5
  6. data/data/ore/templates/base/README.md.erb +3 -0
  7. data/data/ore/templates/base/README.rdoc.erb +3 -0
  8. data/data/ore/templates/base/README.tt.erb +3 -0
  9. data/data/ore/templates/base/template.yml +2 -2
  10. data/data/ore/templates/bin/bin/[name].erb +1 -1
  11. data/data/ore/templates/bundler/Gemfile.erb +14 -3
  12. data/data/ore/templates/bundler/template.yml +7 -2
  13. data/data/ore/templates/bundler_tasks/_tasks.erb +1 -0
  14. data/data/ore/templates/bundler_tasks/template.yml +6 -0
  15. data/data/ore/templates/gem_package_task/_tasks.erb +5 -0
  16. data/data/ore/templates/gem_package_task/template.yml +4 -0
  17. data/data/ore/templates/gemspec/[name].gemspec.erb +45 -0
  18. data/data/ore/templates/gemspec/template.yml +2 -0
  19. data/data/ore/templates/{base → gemspec_yml}/[name].gemspec.erb +36 -55
  20. data/data/ore/templates/gemspec_yml/gemspec.yml.erb +41 -0
  21. data/data/ore/templates/gemspec_yml/template.yml +2 -0
  22. data/data/ore/templates/git/.gitignore.erb +3 -0
  23. data/data/ore/templates/git/template.yml +2 -0
  24. data/data/ore/templates/hg/.hgignore.erb +3 -0
  25. data/data/ore/templates/hg/template.yml +2 -0
  26. data/data/ore/templates/jeweler_tasks/_tasks.erb +3 -12
  27. data/data/ore/templates/jeweler_tasks/template.yml +4 -3
  28. data/data/ore/templates/rdoc/_tasks.erb +1 -1
  29. data/data/ore/templates/rdoc/template.yml +3 -0
  30. data/data/ore/templates/rspec/_tasks.erb +1 -1
  31. data/data/ore/templates/rspec/spec/spec_helper.rb.erb +1 -1
  32. data/data/ore/templates/rspec/template.yml +2 -2
  33. data/data/ore/templates/rubygems_tasks/_tasks.erb +14 -0
  34. data/data/ore/templates/rubygems_tasks/template.yml +7 -0
  35. data/data/ore/templates/rvmrc/.rvmrc.erb +9 -15
  36. data/data/ore/templates/yard/_gemfile_development.erb +0 -1
  37. data/data/ore/templates/yard/_tasks.erb +1 -1
  38. data/data/ore/templates/yard/template.yml +5 -2
  39. data/gemspec.yml +5 -7
  40. data/lib/ore.rb +0 -2
  41. data/lib/ore/actions.rb +85 -0
  42. data/lib/ore/cli.rb +2 -32
  43. data/lib/ore/config.rb +20 -20
  44. data/lib/ore/generator.rb +101 -203
  45. data/lib/ore/naming.rb +160 -0
  46. data/lib/ore/options.rb +67 -0
  47. data/lib/ore/template.rb +8 -0
  48. data/lib/ore/template/directory.rb +60 -41
  49. data/lib/ore/template/helpers.rb +55 -7
  50. data/lib/ore/template/template.rb +61 -0
  51. data/ore.gemspec +35 -55
  52. data/spec/gemspec_examples.rb +33 -0
  53. data/spec/generator_spec.rb +188 -70
  54. data/spec/helpers/generator.rb +4 -2
  55. data/spec/helpers/matchers.rb +33 -0
  56. data/spec/naming_spec.rb +56 -0
  57. data/spec/spec_helper.rb +1 -1
  58. metadata +104 -117
  59. data/data/ore/templates/base/.gitignore.erb +0 -3
  60. data/data/ore/templates/base/_gemfile_development.erb +0 -3
  61. data/data/ore/templates/base/gemspec.yml.erb +0 -30
  62. data/data/ore/templates/bundler/_development_dependencies.erb +0 -1
  63. data/data/ore/templates/bundler/_gitignore.erb +0 -2
  64. data/data/ore/templates/bundler/_tasks.erb +0 -3
  65. data/data/ore/templates/jeweler_tasks/_development_dependencies.erb +0 -3
  66. data/data/ore/templates/jeweler_tasks/_gemfile_development.erb +0 -1
  67. data/data/ore/templates/ore_tasks/_development_dependencies.erb +0 -3
  68. data/data/ore/templates/ore_tasks/_gemfile_development.erb +0 -1
  69. data/data/ore/templates/ore_tasks/_tasks.erb +0 -14
  70. data/data/ore/templates/ore_tasks/template.yml +0 -5
  71. data/data/ore/templates/rdoc/_gitignore.erb +0 -1
  72. data/data/ore/templates/rspec/_development_dependencies.erb +0 -3
  73. data/data/ore/templates/rspec/_gemfile_development.erb +0 -1
  74. data/data/ore/templates/yard/_development_dependencies.erb +0 -1
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ pkg
2
+ doc
3
+ web
4
+ tmp
5
+ .DS_Store
6
+ .bundle
7
+ .yardoc
8
+ *.gem
9
+ *.swp
10
+ *~
data/ChangeLog.md CHANGED
@@ -1,3 +1,49 @@
1
+ ### 0.9.0 / 2012-04-28
2
+
3
+ * Removed the ore-core dependency.
4
+ * Removed the env dependency.
5
+ * Switched from ore-tasks to rubygems-tasks ~> 0.2.
6
+ * Added {Ore::Naming} from `ore-core`.
7
+ * Added {Ore::Options}.
8
+ * Added {Ore::Actions}.
9
+ * Added {Ore::Template::Helpers#rubygems_tasks?}.
10
+ * Added {Ore::Template::Helpers#bundler_tasks?}.
11
+ * Added {Ore::Template::Helpers#gem_package_task?}.
12
+ * Added {Ore::Template::Directory#ignore}.
13
+ * Added {Ore::Template::Directory#dependencies}.
14
+ * Added {Ore::Template::Directory#development_dependencies}.
15
+ * Renamed `Ore::Config.default_options` to {Ore::Config.options}.
16
+ * Renamed `Ore::Generator.defaults` to {Ore::Options.defaults}.
17
+ * Renamed `Ore::Generator.generator_option` to {Ore::Options::ClassMethods}.
18
+ * Renamed `Ore::Generator.templates` to {Ore::Template.templates}.
19
+ * Renamed `Ore::Generator.template?` to {Ore::Template.template?}.
20
+ * Renamed `Ore::Generator.register_template` to {Ore::Template.register}.
21
+
22
+ #### Templates
23
+
24
+ * Added the [gemspec] template.
25
+ * Added the [gemspec_yml] template.
26
+ * Added the [bundler_tasks] template.
27
+ * Added the [gem\_package\_task] template.
28
+ * Added the [hg] template.
29
+ * Added the [rubygems_tasks] template.
30
+ * Removed the `ore_tasks` template.
31
+ * Define dependencies in the `template.yml` files.
32
+ * Simplified the `[name].gemspec` file in the [base] template.
33
+ * Moved the `.gitignore` file into the [git] template.
34
+ * If [git] is enabled and `github.user` is set in `~/.gitconfig`, default
35
+ the `@homepage` variable to a `https://github.com/` URL.
36
+ * Require the newer `rdoc/task` file in the [rdoc] template.
37
+ * Relaxed the `rake` dependency in the [bundler] template to `~> 0.8`.
38
+ * Relaxed the `bundler` dependency in the [bundler` template to `~> 1.0`.
39
+
40
+ #### CLI
41
+
42
+ * Removed the `ore gem` and `ore gemspec` sub-commands.
43
+ * Added the `--bug-tracker` option to `mine`.
44
+ * `mine` now hides the output of all commands.
45
+ * `mine` suppresses all output when `--quiet` is specified.
46
+
1
47
  ### 0.8.1 / 2011-07-11
2
48
 
3
49
  * Generated `.gemspec` file:
@@ -20,7 +66,7 @@
20
66
  ### 0.7.2 / 2011-02-26
21
67
 
22
68
  * Require ore-core ~> 0.1, >= 0.1.4.
23
- * Added {Ore::Generator.template?}.
69
+ * Added `Ore::Generator.template?`.
24
70
  * Added {Ore::Generator#enabled_templates}.
25
71
  * Added {Ore::Generator#disabled_templates}.
26
72
  * Added {Ore::Generator#templates}.
@@ -41,8 +87,8 @@
41
87
 
42
88
  ### 0.7.1 / 2011-02-20
43
89
 
44
- * Added {Ore::Generator#generate_dir}.
45
- * Added {Ore::Generator#generate_file}.
90
+ * Added `Ore::Generator#generate_dir`.
91
+ * Added `Ore::Generator#generate_file`.
46
92
  * Only chmod generated files, if they are supposed to be executable.
47
93
 
48
94
  ### 0.7.0 / 2011-02-19
@@ -89,9 +135,9 @@
89
135
  * Added `lib/ore.rb`.
90
136
  * Added {Ore::Config.enable!}.
91
137
  * Added {Ore::Config.disable!}.
92
- * Added {Ore::Config.default_options}.
93
- * Added {Ore::Generator.defaults}.
94
- * Added {Ore::Generator.generator_option}.
138
+ * Added `Ore::Config.default_options`.
139
+ * Added `Ore::Generator.defaults`.
140
+ * Added `Ore::Generator.generator_option`.
95
141
  * Added `vendor/cache/*.gem` to `.gitignore` if `--bundler` is specified.
96
142
  * Attempt to auto-load `ore/specification` in the generated `*.gemspec`
97
143
  files.
@@ -145,7 +191,7 @@
145
191
  [ore-core](http://github.com/ruby-ore/ore-core).
146
192
  * {Ore::Generator}:
147
193
  * Added {Ore::Template::Helpers#jeweler_tasks?}.
148
- * Added {Ore::Template::Helpers#ore_tasks?}.
194
+ * Added `Ore::Template::Helpers#ore_tasks?`.
149
195
  * Do not include `ore-core` as a development dependency if either
150
196
  `--bundler` or `--ore-tasks` is enabled.
151
197
 
@@ -233,3 +279,20 @@
233
279
  * Added {Ore::Template::Helpers}.
234
280
  * Added {Ore::Generator}.
235
281
 
282
+ [base]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/base
283
+ [bin]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/bin
284
+ [bundler]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/bundler
285
+ [bundler_tasks]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/bundler_tasks
286
+ [gemspec]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gemspec
287
+ [gemspec_yml]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gemspec_yml
288
+ [gem\_package\_task]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gem_package_task
289
+ [gem_test]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/gem_test
290
+ [git]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/git
291
+ [hg]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/hg
292
+ [jeweler_tasks]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/jeweler_tasks
293
+ [rdoc]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rdoc
294
+ [rspec]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rspec
295
+ [rubygems_tasks]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rubygems_tasks
296
+ [rvmrc]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/rvmrc
297
+ [test_unit]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/test_unit
298
+ [yard]: https://github.com/ruby-ore/ore/tree/master/data/ore/templates/yard
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2011 Hal Brodigan
1
+ Copyright (c) 2010-2012 Hal Brodigan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # Ore
2
2
 
3
- * [Source](http://github.com/ruby-ore/ore)
4
- * [Issues](http://github.com/ruby-ore/ore/issues)
3
+ * [Source](https://github.com/ruby-ore/ore)
4
+ * [Issues](https://github.com/ruby-ore/ore/issues)
5
5
  * [Documentation](http://rubydoc.info/gems/ore/frames)
6
6
  * [Email](mailto:postmodern.mod3 at gmail.com)
7
- * IRC: irc.freenode.net #ruby-ore
8
7
 
9
8
  ## Description
10
9
 
@@ -14,95 +13,76 @@ templates to be installed from Git repositories.
14
13
 
15
14
  ## Features
16
15
 
17
- * Stores project metadata in **one YAML file** (`gemspec.yml`).
18
- * Generates a **pure Ruby** `.gemspec` supporting:
19
- * [Git](http://git-scm.com/)
20
- * [Mercurial (Hg)](http://mercurial.selenic.com/)
21
- * [SubVersion (SVN)](http://subversion.tigris.org/)
22
- * `gemspec.yml`
23
- * `VERSION` or `version.rb` files
24
- * Provides many builtin templates:
25
- * bundler
26
- * rvmrc
27
- * jeweler
28
- * rdoc
29
- * yard
30
- * test_unit
31
- * rspec
32
- * gem_test
33
- * Allows installing custom templates from Git repositories:
34
-
35
- $ ore install git://github.com/ruby-ore/cucumber.git
16
+ ### SCMs
36
17
 
37
- ## Requirements
18
+ Ore supports generating [Git][git], [Mercurial][hg] and [SubVersion][svn]
19
+ enabled projects.
38
20
 
39
- * [ore-core](http://github.com/ruby-ore/ore-core) ~> 0.1, >= 0.1.4
40
- * [env](http://github.com/postmodern/env) ~> 0.1.2
41
- * [thor](http://github.com/wycats/thor) ~> 0.14.3
21
+ $ mine my-project [--git | --hg]
42
22
 
43
- ## Install
23
+ ### Gemspec
44
24
 
45
- $ gem install ore
25
+ Ore generates a pure-Ruby gemspec by default. Ore can also generate a
26
+ [gemspec.yml] file.
46
27
 
47
- ## Example gemspec.yml File
48
-
49
- The `gemspec.yml` file used to build Ore:
50
-
51
- name: ore
52
- version: 0.8.1
53
- summary: Mine raw RubyGems from YAML.
54
- description:
55
- Ore is a simple RubyGem building solution. Ore handles the
56
- creation of Gem::Specification objects as well as building '.gem'
57
- files. Ore allows the developer to keep all of the project information
58
- in a single YAML file.
59
-
60
- license: MIT
61
- authors: Postmodern
62
- email: postmodern.mod3@gmail.com
63
- homepage: http://github.com/ruby-ore/ore
64
- post_install_message: |
65
- **************************************************************************
66
- Generate a new Ruby library:
67
-
68
- $ mine my_library --rspec --yard
69
-
70
- Build the library:
71
-
72
- $ rake build
73
-
74
- Release the library to rubygems.org:
75
-
76
- $ rake release
77
-
78
- **************************************************************************
79
-
80
- dependencies:
81
- ore-core: ~> 0.1, >= 0.1.4
82
- env: ~> 0.1.2
83
- thor: ~> 0.14.3
84
-
85
- development_dependencies:
86
- ore-tasks: ~> 0.4
87
- rspec: ~> 2.4
88
- yard: ~> 0.7.0
89
-
90
- For a complete refrence to the `gemspec.yml` file, please see the
91
- [GemspecYML Reference](http://rubydoc.info/gems/ore/file/GemspecYML.html).
28
+ ### Tasks
92
29
 
93
- ## Synopsis
30
+ Ore supports generating projects using [Gem::Tasks][rubygems_tasks],
31
+ [Bundler::GemHelper][bundler], [Jeweler::Tasks][jeweler] and even
32
+ [Gem::PackageTask][gem_package_task].
94
33
 
95
- Install a custom template:
34
+ $ mine my-project [--rubygems-tasks |
35
+ --bundler-tasks |
36
+ --jeweler-tasks |
37
+ --gem-package-task]
38
+
39
+ ### Bundler
40
+
41
+ Ore can also generate a [Bundler][bundler] project.
42
+
43
+ $ mine my-project --bundler
44
+
45
+ ### RVM
46
+
47
+ Ore also includes an [.rvmrc] template.
48
+
49
+ $ mine my-project --rvmrc
50
+
51
+ ### Markup
52
+
53
+ Ore supports [RDoc][rdoc], [Markdown][markdown] and [Textile][textile] markup.
54
+
55
+ $ mine my-project [--rdoc | --markdown | --textile]
56
+
57
+ ### Documentation
58
+
59
+ Ore supports generating projects with [RDoc][rdoc] or [YARD][yard]
60
+ documentation.
61
+
62
+ $ mine my-project [--rdoc | --yard]
63
+
64
+ ### Testing
65
+
66
+ Ore supports generating [RSpec][rspec] or [Test::Unit][test_unit] tests.
67
+
68
+ $ mine my-project [--test-unit | --rspec]
69
+
70
+ ### Custom Templates
71
+
72
+ Additional templates can also be installed from Git:
96
73
 
97
74
  $ ore install git://github.com/ruby-ore/mini_test.git
75
+ $ mine my-project --mini-test
98
76
 
99
- List installed templates:
77
+ ## Requirements
100
78
 
101
- $ ore list
79
+ * [thor](http://github.com/wycats/thor) ~> 0.14.3
102
80
 
103
- Remove a previously installed template:
81
+ ## Install
104
82
 
105
- $ ore remove mini_test
83
+ $ gem install ore
84
+
85
+ ## Synopsis
106
86
 
107
87
  Generate a new project:
108
88
 
@@ -116,22 +96,47 @@ Generate a new project using previously installed templates:
116
96
 
117
97
  $ mine my_project --bundler --rspec --yard --templates mini_test
118
98
 
99
+ Install a custom template:
100
+
101
+ $ ore install git://github.com/ruby-ore/mini_test.git
102
+
103
+ List installed templates:
104
+
105
+ $ ore list
106
+
107
+ Remove a previously installed template:
108
+
109
+ $ ore remove mini_test
110
+
119
111
  Add default generator options to `~/.ore/options.yml`:
120
112
 
121
- ore_tasks: true
122
- rspec: true
123
- yard: true
124
- markdown: true
113
+ gemspec_yml: true
114
+ rubygems_tasks: true
115
+ rspec: true
116
+ yard: true
117
+ markdown: true
125
118
  authors:
126
119
  - Alice
127
120
  email: alice@example.com
128
121
 
129
- Build a `.gem` file in the `pkg/` directory of a project:
130
-
131
- $ ore gem
132
-
133
122
  ## License
134
123
 
135
- Copyright (c) 2010-2011 Hal Brodigan
124
+ Copyright (c) 2010-2012 Hal Brodigan
136
125
 
137
126
  See {file:LICENSE.txt} for license information.
127
+
128
+ [git]: http://git-scm.com/
129
+ [hg]: http://mercurial.selenic.com/
130
+ [svn]: http://subversion.tigris.org/
131
+ [gemspec.yml]: https://github.com/ruby-ore/ore/blob/master/gemspec.yml
132
+ [rubygems_tasks]: https://github.com/postmodern/rubygems-tasks#readme
133
+ [bundler]: http://gembundler.com/
134
+ [jeweler]: https://github.com/technicalpickles/jeweler#readme
135
+ [gem_package_task]: http://rubygems.rubyforge.org/rubygems-update/Gem/PackageTask.html
136
+ [.rvmrc]: https://rvm.io/workflow/rvmrc/#project
137
+ [rdoc]: http://rdoc.rubyforge.org/
138
+ [markdown]: http://daringfireball.net/projects/markdown/
139
+ [textile]: http://textile.sitemonks.com/
140
+ [yard]: http://yardoc.org/
141
+ [rspec]: http://rspec.info/
142
+ [test_unit]: http://test-unit.rubyforge.org/
data/Rakefile CHANGED
@@ -2,13 +2,13 @@ require 'rubygems'
2
2
  require 'rake'
3
3
 
4
4
  begin
5
- gem 'ore-tasks', '~> 0.4'
6
- require 'ore/tasks'
5
+ gem 'rubygems-tasks', '~> 0.2'
6
+ require 'rubygems/tasks'
7
7
 
8
- Ore::Tasks.new
8
+ Gem::Tasks.new
9
9
  rescue LoadError => e
10
10
  warn e.message
11
- warn "Run `gem install ore-tasks` to install 'ore/tasks'."
11
+ warn "Run `gem install rubygems-tasks` to install 'rubygems/tasks'."
12
12
  end
13
13
 
14
14
  begin
@@ -25,7 +25,7 @@ task :test => :spec
25
25
  task :default => :spec
26
26
 
27
27
  begin
28
- gem 'yard', '~> 0.6.0'
28
+ gem 'yard', '~> 0.7'
29
29
  require 'yard'
30
30
 
31
31
  YARD::Rake::YardocTask.new
@@ -3,6 +3,9 @@
3
3
  <%- if @homepage -%>
4
4
  * [Homepage](<%= @homepage %>)
5
5
  <%- end -%>
6
+ <%- if @bug_tracker -%>
7
+ * [Issues](<%= @bug_tracker %>)
8
+ <%- end -%>
6
9
  * [Documentation](http://rubydoc.info/gems/<%= @name %>/frames)
7
10
  <%- if @safe_email -%>
8
11
  * [Email](mailto:<%= @safe_email %>)
@@ -3,6 +3,9 @@
3
3
  <%- if @homepage -%>
4
4
  * {Homepage}[<%= @homepage %>]
5
5
  <%- end -%>
6
+ <%- if @bug_tracker -%>
7
+ * {Issues}[<%= @bug_tracker %>]
8
+ <%- end -%>
6
9
  * {Documentation}[http://rubydoc.info/gems/<%= @name %>/frames]
7
10
  <%- if @safe_email -%>
8
11
  * {Email}[mailto:<%= @safe_email %>]
@@ -3,6 +3,9 @@ h1. <%= @name %>
3
3
  <%- if @homepage -%>
4
4
  * "Homepage":<%= @homepage %>
5
5
  <%- end -%>
6
+ <%- if @bug_tracker -%>
7
+ * "Issues":<%= @bug_tracker %>
8
+ <%- end -%>
6
9
  * "Documentation":http://rubydoc.info/gems/<%= @name %>/frames
7
10
  <%- if @safe_email -%>
8
11
  * "Email":mailto:<%= @safe_email %>
@@ -1,2 +1,2 @@
1
- variables:
2
- ore_core_dependency: ~> 0.1
1
+ ignore:
2
+ - pkg/
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- <%- if (bundler? && git?) -%>
3
+ <%- if (bundler? && (git? || hg?)) -%>
4
4
  root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
5
5
  if File.directory?(File.join(root_dir,'.git'))
6
6
  Dir.chdir(root_dir) do |path|
@@ -5,12 +5,23 @@ source :rubygems
5
5
  <%- end -%>
6
6
 
7
7
  gemspec
8
-
9
8
  <%- includes(:gemfile,'') do |gemfile| -%>
9
+
10
10
  <%= gemfile %>
11
+ <%- end -%>
12
+ <%- unless @dependencies.empty? -%>
11
13
 
14
+ <%- @dependencies.each do |name,version| -%>
15
+ gem '<%= name %>', '<%= version %>'
16
+ <%- end -%>
12
17
  <%- end -%>
18
+
13
19
  group :development do
14
- gem 'rake', '~> 0.8.7'
15
- <%= includes :gemfile_development, '' -%>
20
+ <%= includes(:gemfile_development,'') -%>
21
+ <%- unless @development_dependencies.empty? -%>
22
+
23
+ <%- @development_dependencies.each do |name,version| -%>
24
+ gem '<%= name %>', '<%= version %>'
25
+ <%- end -%>
26
+ <%- end -%>
16
27
  end