ore 0.1.2
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/.document +4 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +31 -0
- data/GemspecYML.md +252 -0
- data/LICENSE.txt +21 -0
- data/README.md +104 -0
- data/Rakefile +9 -0
- data/bin/mine +12 -0
- data/bin/ore +12 -0
- data/data/ore/templates/base/.document +3 -0
- data/data/ore/templates/base/.gitignore.erb +3 -0
- data/data/ore/templates/base/:name:.gemspec.erb +10 -0
- data/data/ore/templates/base/ChangeLog.md.erb +4 -0
- data/data/ore/templates/base/ChangeLog.rdoc.erb +4 -0
- data/data/ore/templates/base/ChangeLog.tt.erb +4 -0
- data/data/ore/templates/base/LICENSE.txt.erb +20 -0
- data/data/ore/templates/base/README.md.erb +42 -0
- data/data/ore/templates/base/README.rdoc.erb +38 -0
- data/data/ore/templates/base/README.tt.erb +44 -0
- data/data/ore/templates/base/Rakefile.erb +23 -0
- data/data/ore/templates/base/gemspec.yml.erb +23 -0
- data/data/ore/templates/base/lib/:namespace_dir:.rb.erb +1 -0
- data/data/ore/templates/base/lib/:namespace_dir:/version.rb.erb +8 -0
- data/data/ore/templates/bundler/Gemfile.erb +20 -0
- data/data/ore/templates/bundler/_dependencies.erb +1 -0
- data/data/ore/templates/jeweler_tasks/_dependencies.erb +3 -0
- data/data/ore/templates/jeweler_tasks/_tasks.erb +17 -0
- data/data/ore/templates/ore_tasks/_dependencies.erb +1 -0
- data/data/ore/templates/ore_tasks/_tasks.erb +12 -0
- data/data/ore/templates/rdoc/_tasks.erb +6 -0
- data/data/ore/templates/rspec/.rspec +1 -0
- data/data/ore/templates/rspec/_dependencies.erb +3 -0
- data/data/ore/templates/rspec/_tasks.erb +14 -0
- data/data/ore/templates/rspec/spec/:namespace_dir:_spec.rb.erb +8 -0
- data/data/ore/templates/rspec/spec/spec_helper.rb.erb +7 -0
- data/data/ore/templates/test_unit/test/helper.rb.erb +24 -0
- data/data/ore/templates/test_unit/test/test_:name:.rb.erb +5 -0
- data/data/ore/templates/yard/.yardopts.erb +1 -0
- data/data/ore/templates/yard/_dependencies.erb +1 -0
- data/data/ore/templates/yard/_gem.erb +1 -0
- data/data/ore/templates/yard/_tasks.erb +13 -0
- data/gemspec.yml +21 -0
- data/lib/ore.rb +3 -0
- data/lib/ore/checks.rb +85 -0
- data/lib/ore/cli.rb +120 -0
- data/lib/ore/config.rb +52 -0
- data/lib/ore/defaults.rb +137 -0
- data/lib/ore/dependency.rb +62 -0
- data/lib/ore/document_file.rb +118 -0
- data/lib/ore/exceptions.rb +3 -0
- data/lib/ore/exceptions/exception.rb +4 -0
- data/lib/ore/exceptions/invalid_metadata.rb +6 -0
- data/lib/ore/exceptions/project_not_found.rb +6 -0
- data/lib/ore/generator.rb +247 -0
- data/lib/ore/naming.rb +95 -0
- data/lib/ore/paths.rb +143 -0
- data/lib/ore/project.rb +568 -0
- data/lib/ore/settings.rb +236 -0
- data/lib/ore/specification.rb +29 -0
- data/lib/ore/template.rb +3 -0
- data/lib/ore/template/directory.rb +179 -0
- data/lib/ore/template/helpers.rb +144 -0
- data/lib/ore/template/interpolations.rb +31 -0
- data/lib/ore/versions.rb +3 -0
- data/lib/ore/versions/exceptions.rb +1 -0
- data/lib/ore/versions/exceptions/invalid_version.rb +8 -0
- data/lib/ore/versions/version.rb +75 -0
- data/lib/ore/versions/version_constant.rb +126 -0
- data/lib/ore/versions/version_file.rb +66 -0
- data/lib/rubygems_plugin.rb +40 -0
- data/ore.gemspec +6 -0
- data/spec/dependency_spec.rb +36 -0
- data/spec/document_file_spec.rb +29 -0
- data/spec/helpers/files.rb +7 -0
- data/spec/helpers/files/.document +5 -0
- data/spec/helpers/files/VERSION +1 -0
- data/spec/helpers/files/VERSION.yml +5 -0
- data/spec/helpers/projects.rb +13 -0
- data/spec/helpers/projects/dm-plugin/Gemfile +3 -0
- data/spec/helpers/projects/dm-plugin/VERSION +1 -0
- data/spec/helpers/projects/dm-plugin/dm-plugin.gemspec +10 -0
- data/spec/helpers/projects/dm-plugin/gemspec.yml +7 -0
- data/spec/helpers/projects/dm-plugin/lib/dm-plugin.rb +1 -0
- data/spec/helpers/projects/explicit/gemspec.yml +10 -0
- data/spec/helpers/projects/explicit/lib/explicit/version.rb +15 -0
- data/spec/helpers/projects/ffi-binding/gemspec.yml +7 -0
- data/spec/helpers/projects/ffi-binding/lib/ffi/binding/version.rb +5 -0
- data/spec/helpers/projects/jewelery/VERSION +1 -0
- data/spec/helpers/projects/jewelery/bin/jewelery +3 -0
- data/spec/helpers/projects/jewelery/gemspec.yml +4 -0
- data/spec/helpers/projects/jewelery/jewelery.gemspec +10 -0
- data/spec/helpers/projects/jewelery/lib/jewelery.rb +4 -0
- data/spec/helpers/projects/jewelery/lib/jewelery/rubies.rb +4 -0
- data/spec/helpers/projects/minimal/gemspec.yml +4 -0
- data/spec/helpers/projects/minimal/lib/minimal.rb +2 -0
- data/spec/naming_spec.rb +48 -0
- data/spec/projects/dm_plugin_project_spec.rb +29 -0
- data/spec/projects/explicit_project_spec.rb +33 -0
- data/spec/projects/ffi_binding_project_spec.rb +21 -0
- data/spec/projects/jeweler_project_spec.rb +17 -0
- data/spec/projects/minimal_project_spec.rb +17 -0
- data/spec/projects/project_examples.rb +34 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/versions/version_file_spec.rb +28 -0
- data/spec/versions/version_spec.rb +53 -0
- metadata +226 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module Ore
|
|
2
|
+
#
|
|
3
|
+
# Provides transparent access to {Ore::Specification}.
|
|
4
|
+
#
|
|
5
|
+
# @param [Symbol] name
|
|
6
|
+
# The constant name.
|
|
7
|
+
#
|
|
8
|
+
# @return [Object]
|
|
9
|
+
# The constant.
|
|
10
|
+
#
|
|
11
|
+
# @raise [NameError]
|
|
12
|
+
# The constant could not be found.
|
|
13
|
+
#
|
|
14
|
+
def self.const_missing(name)
|
|
15
|
+
if name == :Specification
|
|
16
|
+
begin
|
|
17
|
+
# attempt to load 'ore/specification' from the $LOAD_PATH
|
|
18
|
+
require 'ore/specification'
|
|
19
|
+
rescue ::LoadError
|
|
20
|
+
# find our `lib/` directory
|
|
21
|
+
lib_dir = File.expand_path(File.dirname(__FILE__))
|
|
22
|
+
|
|
23
|
+
# modify the $LOAD_PATH is 'ore/specification' is not available
|
|
24
|
+
$LOAD_PATH << ORE_LIB_DIR unless $LOAD_PATH.include?(ORE_LIB_DIR)
|
|
25
|
+
|
|
26
|
+
begin
|
|
27
|
+
# attempt loading 'ore/specification' again
|
|
28
|
+
require 'ore/specification'
|
|
29
|
+
rescue ::LoadError
|
|
30
|
+
# ore is probably not installed, so raise a NameError
|
|
31
|
+
return super(name)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
return Ore.const_get(name)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
super(name)
|
|
39
|
+
end
|
|
40
|
+
end
|
data/ore.gemspec
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'ore/dependency'
|
|
3
|
+
|
|
4
|
+
describe Dependency do
|
|
5
|
+
subject { Dependency }
|
|
6
|
+
|
|
7
|
+
describe "parse" do
|
|
8
|
+
it "should parse a dependency string with only a name" do
|
|
9
|
+
dep = subject.parse('foo')
|
|
10
|
+
|
|
11
|
+
dep.name.should == 'foo'
|
|
12
|
+
dep.versions.should be_empty
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should parse a dependency with a version" do
|
|
16
|
+
dep = subject.parse('foo ~> 1.2.3')
|
|
17
|
+
|
|
18
|
+
dep.name.should == 'foo'
|
|
19
|
+
dep.versions.should == ['~> 1.2.3']
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe "parse_versions" do
|
|
24
|
+
it "should parse a single version" do
|
|
25
|
+
dep = subject.parse_versions('foo', '~> 1.2.3')
|
|
26
|
+
|
|
27
|
+
dep.versions.should == ['~> 1.2.3']
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "should parse multiple versions" do
|
|
31
|
+
dep = subject.parse_versions('foo', '~> 1.2.3, >= 1.4.0')
|
|
32
|
+
|
|
33
|
+
dep.versions.should == ['~> 1.2.3', '>= 1.4.0']
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'helpers/files'
|
|
3
|
+
|
|
4
|
+
require 'ore/document_file'
|
|
5
|
+
|
|
6
|
+
describe DocumentFile do
|
|
7
|
+
include Helpers::Files
|
|
8
|
+
|
|
9
|
+
subject { DocumentFile.new(file('.document')) }
|
|
10
|
+
|
|
11
|
+
it "should parse the file globs from a .document file" do
|
|
12
|
+
subject.file_globs.to_a.should =~ %w[
|
|
13
|
+
lib/**/*.rb
|
|
14
|
+
bin/*
|
|
15
|
+
]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should parse the extra-file globs from a .document file" do
|
|
19
|
+
subject.extra_file_globs.to_a.should =~ %w[
|
|
20
|
+
ChangeLog.md
|
|
21
|
+
COPYING.txt
|
|
22
|
+
]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should not consume the - separator" do
|
|
26
|
+
subject.file_globs.should_not include('-')
|
|
27
|
+
subject.extra_file_globs.should_not include('-')
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.2.3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.2.3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'dm-core'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
name: Explicit
|
|
2
|
+
summary: An explicit library
|
|
3
|
+
description: This is a library written by strict developers.
|
|
4
|
+
license: MIT
|
|
5
|
+
authors:
|
|
6
|
+
- Senior Software Engineer
|
|
7
|
+
- Junior Software Engineer
|
|
8
|
+
|
|
9
|
+
required_ruby_version: >= 1.8.7
|
|
10
|
+
required_rubygems_version: >= 1.3.7
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.2.3
|
data/spec/naming_spec.rb
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'ore/naming'
|
|
3
|
+
|
|
4
|
+
describe Naming do
|
|
5
|
+
subject do
|
|
6
|
+
obj = Object.new
|
|
7
|
+
obj.extend Ore::Naming
|
|
8
|
+
obj
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
describe "underscore" do
|
|
12
|
+
it "should underscore CamelCase names" do
|
|
13
|
+
subject.underscore('FooBar').should == 'foo_bar'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should not add leading underscores to Capitalized names" do
|
|
17
|
+
subject.underscore('Foo').should == 'foo'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should not add tailing underscores to CamelCase names" do
|
|
21
|
+
subject.underscore('FooX').should == 'foox'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "should not add underscores when they already exist" do
|
|
25
|
+
subject.underscore('Foo_Bar').should == 'foo_bar'
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it "should guess the module names from a project name" do
|
|
30
|
+
subject.modules_of('foo-bar').should == ['Foo', 'Bar']
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should recognize common acronyms in project names" do
|
|
34
|
+
subject.modules_of('ffi-bar').should == ['FFI', 'Bar']
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it "should guess the namespace from a project name" do
|
|
38
|
+
subject.namespace_of('foo-bar').should == 'Foo::Bar'
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "should guess the namespace directories from a project name" do
|
|
42
|
+
subject.namespace_dirs_of('foo-bar').should == ['foo', 'bar']
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "should guess the namespace directory from a project name" do
|
|
46
|
+
subject.namespace_path_of('foo-bar').should == 'foo/bar'
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'helpers/projects'
|
|
3
|
+
require 'projects/project_examples'
|
|
4
|
+
|
|
5
|
+
describe "DataMapper Plugin project" do
|
|
6
|
+
include Helpers::Projects
|
|
7
|
+
|
|
8
|
+
before(:all) do
|
|
9
|
+
@project = project('dm-plugin')
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it_should_behave_like 'an Ore Project'
|
|
13
|
+
|
|
14
|
+
it "should correctly guess the namespace" do
|
|
15
|
+
@project.namespace.should == 'DataMapper::Plugin'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should have a namespace directory" do
|
|
19
|
+
@project.namespace_dir.should == 'dm-plugin'
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "should use Bundler" do
|
|
23
|
+
@project.should be_bundler
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "should default the required RubyGems version to >= 1.3.6" do
|
|
27
|
+
@project.required_rubygems_version.should == '>= 1.3.6'
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'helpers/projects'
|
|
3
|
+
require 'projects/project_examples'
|
|
4
|
+
|
|
5
|
+
describe "Explicit project" do
|
|
6
|
+
include Helpers::Projects
|
|
7
|
+
|
|
8
|
+
before(:all) do
|
|
9
|
+
@project = project('explicit')
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it_should_behave_like 'an Ore Project'
|
|
13
|
+
|
|
14
|
+
it "should have a namespace directory" do
|
|
15
|
+
@project.namespace_dir.should == 'explicit'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should have a license" do
|
|
19
|
+
@project.license.should == 'MIT'
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "should have a licenses" do
|
|
23
|
+
@project.licenses.should == ['MIT']
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "should have a required Ruby version" do
|
|
27
|
+
@project.required_ruby_version.should == '>= 1.8.7'
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "should have a required RubyGems version" do
|
|
31
|
+
@project.required_rubygems_version.should == '>= 1.3.7'
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'helpers/projects'
|
|
3
|
+
require 'projects/project_examples'
|
|
4
|
+
|
|
5
|
+
describe "FFI Bindings project" do
|
|
6
|
+
include Helpers::Projects
|
|
7
|
+
|
|
8
|
+
before(:all) do
|
|
9
|
+
@project = project('ffi-binding')
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it_should_behave_like 'an Ore Project'
|
|
13
|
+
|
|
14
|
+
it "should correctly guess the namespace" do
|
|
15
|
+
@project.namespace.should == 'FFI::Binding'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should have a namespace directory" do
|
|
19
|
+
@project.namespace_dir.should == 'ffi/binding'
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'helpers/projects'
|
|
3
|
+
require 'projects/project_examples'
|
|
4
|
+
|
|
5
|
+
describe "Jeweler project" do
|
|
6
|
+
include Helpers::Projects
|
|
7
|
+
|
|
8
|
+
before(:all) do
|
|
9
|
+
@project = project('jewelery')
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it_should_behave_like 'an Ore Project'
|
|
13
|
+
|
|
14
|
+
it "should have a namespace directory" do
|
|
15
|
+
@project.namespace_dir.should == 'jewelery'
|
|
16
|
+
end
|
|
17
|
+
end
|