jrun-rstack 0.5.4 → 0.5.5

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.
@@ -1,12 +1,13 @@
1
1
  require 'rubygems'
2
- require 'extlib'
2
+ require 'pathname'
3
3
 
4
4
  module RStack
5
5
  def self.root
6
- Pathname.new(File.dirname(__FILE__)).parent.expand_path
6
+ @root ||= Pathname.new(File.dirname(__FILE__)).parent.expand_path
7
7
  end
8
8
 
9
9
  def self.vendor
10
- root / 'vendor'
10
+ @vendor ||= root.join('vendor')
11
11
  end
12
12
  end
13
+
@@ -1,14 +1,15 @@
1
- Pathname.glob((RStack.vendor / '**').to_s).each do |dir|
1
+ Dir[RStack.vendor.join('**').to_s].each do |dir|
2
2
  $:.unshift File.directory?(lib = "#{dir}/lib") ? lib : dir
3
3
  end
4
4
 
5
5
  require 'rake/gempackagetask'
6
6
  require 'spec/rake/spectask'
7
7
 
8
+ require 'rstack/core_ext'
8
9
  require 'rstack/version'
9
10
  require 'rstack/generator'
10
11
 
11
- Pathname.glob((RStack.root / 'lib/rstack/tasks/*.rb').to_s).each {|f| require f }
12
+ Dir[RStack.root.join('lib/rstack/tasks/*.rb').to_s].each {|f| require f }
12
13
 
13
14
  module RStack
14
15
  class Configuration
@@ -18,13 +19,13 @@ module RStack
18
19
  :runtime_dependencies, :development_dependencies
19
20
 
20
21
  attr_reader :outpath
21
-
22
+
22
23
  def initialize(gem_name)
23
24
  @gem_name = gem_name
24
25
  @summary = '[ENTER A SUMMARY]'
25
26
  @author = '[ENTER A AUTHOR]'
26
27
  @email = '[ENTER YOUR EMAIL]'
27
- @url = '[ENTER A PROJECT URL]'
28
+ @url = ''
28
29
  @require_path = 'lib'
29
30
  @version = "0.1.0"
30
31
  @platform = ::Gem::Platform::RUBY
@@ -74,7 +75,7 @@ module RStack
74
75
  private :filelist_to_cleaned_a
75
76
 
76
77
  def default_outpath
77
- FileUtils.getwd / 'out'
78
+ File.join(FileUtils.getwd, 'out')
78
79
  end
79
80
  private :default_outpath
80
81
  end
@@ -0,0 +1,39 @@
1
+ # Copyright (c) 2005-2009 David Heinemeier Hansson
2
+ #
3
+ #Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ # Methods from ActiveSupport, slightly modified to support only what
23
+ # rstack needs and to minimize the amount of core_ext required.
24
+ #
25
+ unless defined?(ActiveSupport)
26
+ class String
27
+ def underscore
28
+ self.gsub(/::/, '/').
29
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
30
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
31
+ tr("-", "_").
32
+ downcase
33
+ end
34
+
35
+ def camelize
36
+ self.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
37
+ end
38
+ end
39
+ end
@@ -6,34 +6,34 @@ module RStack
6
6
 
7
7
  def initialize(project_name)
8
8
  @project_name = project_name.downcase
9
- @pathized_project_name = @project_name.to_const_path
10
- @module_name = @pathized_project_name.camel_case
11
- @path = Pathname.new(@project_name)
9
+ @pathized_project_name = @project_name.underscore
10
+ @module_name = @pathized_project_name.camelize
11
+ @path = Pathname.new(@project_name).expand_path
12
12
 
13
13
  parts = @pathized_project_name.split("/")
14
14
  @main = parts.last + ".rb"
15
15
  @main_path = Pathname.new((parts - [parts.last]).join("/"))
16
- @templates_path = Pathname.new(RStack.root) / 'templates'
16
+ @templates_path = RStack.root.join('templates')
17
17
  end
18
18
 
19
19
  def paths
20
20
  {
21
- :bin => path / "bin",
22
- :lib => path / 'lib',
23
- :main => path / "lib" / @main_path,
24
- :project => path / "lib" / @pathized_project_name,
25
- :spec => path / "spec"
21
+ :bin => path.join('bin'),
22
+ :lib => path.join('lib'),
23
+ :main => path.join('lib', @main_path),
24
+ :project => path.join('lib', @pathized_project_name),
25
+ :spec => path.join('spec')
26
26
  }
27
27
  end
28
28
 
29
29
  def run
30
30
  create_directories
31
- move_template "Rakefile", path / "Rakefile"
32
- move_template "README.txt", path / "README.txt"
33
- move_template "cruise_config.rb", path / "cruise_config.rb"
34
- move_template "main.rb", paths[:main] / @main
35
- move_template "version.rb", paths[:project] / "version.rb"
36
- move_template "spec_helper.rb", paths[:spec] / "spec_helper.rb"
31
+ move_template "Rakefile", path.join('Rakefile')
32
+ move_template "README.txt", path.join('README.txt')
33
+ move_template "cruise_config.rb", path.join('cruise_config.rb')
34
+ move_template "main.rb", paths[:main].join(@main)
35
+ move_template "version.rb", paths[:project].join('version.rb')
36
+ move_template "spec_helper.rb", paths[:spec].join('spec_helper.rb')
37
37
  end
38
38
 
39
39
  def create_directories
@@ -55,4 +55,4 @@ module RStack
55
55
  ENV['USERNAME'] || ENV['USER'] || '[ENTER YOUR USERNAME]'
56
56
  end
57
57
  end
58
- end
58
+ end
@@ -4,12 +4,12 @@ module RStack
4
4
  require 'rake/rdoctask'
5
5
  ::Rake::RDocTask.new do |rdoc|
6
6
  rdoc.rdoc_files.add configuration.rdoc_files
7
- rdoc.rdoc_dir = configuration.outpath + '/doc'
7
+ rdoc.rdoc_dir = File.join(configuration.outpath, 'doc')
8
8
  rdoc.title = "#{configuration.gem_name} -- #{configuration.version}"
9
9
  rdoc.main = 'README.txt'
10
- rdoc.template = RStack.vendor / 'allison-2.0.2' / 'lib' / 'allison.rb'
10
+ rdoc.template = RStack.vendor.join('allison-2.0.2/lib/allison.rb')
11
11
  rdoc.options << '--line-numbers' << '--inline-source'
12
12
  end
13
13
  end
14
14
  end
15
- end
15
+ end
@@ -1,3 +1,5 @@
1
+ require 'rubygems'
2
+
1
3
  module RStack
2
4
  class Gem
3
5
  def self.define_tasks(configuration)
@@ -14,11 +16,10 @@ module RStack
14
16
  s.add_development_dependency "rstack", ">= #{RStack::Version::STRING}"
15
17
  end
16
18
 
17
- s.add_dependency 'rake', '>= 0.8.1'
18
- s.add_dependency 'extlib'
19
- s.add_development_dependency 'rcov', '>= 0.8.0'
20
- s.add_development_dependency 'diff-lcs', '>= 1.1.2'
21
- s.add_development_dependency 'rspec', '>= 1.1.3'
19
+ s.add_dependency 'rake', '>= 0.8.1'
20
+ s.add_development_dependency 'rcov', '>= 0.8.0'
21
+ s.add_development_dependency 'diff-lcs', '>= 1.1.2'
22
+ s.add_development_dependency 'rspec', '>= 1.1.3'
22
23
 
23
24
  configuration.dependencies.each do |dependency, version|
24
25
  s.add_dependency dependency, version
@@ -28,7 +29,7 @@ module RStack
28
29
  s.add_runtime_dependency dependency, version
29
30
  end
30
31
 
31
- configuration.development_dependencies.each do |dependency, version|
32
+ configuration.development_dependencies.each do |dependency, version|
32
33
  s.add_development_dependency dependency, version
33
34
  end
34
35
 
@@ -39,7 +40,18 @@ module RStack
39
40
  #s.extra_rdoc_files = ["README.txt"]
40
41
  end
41
42
  ::Rake::GemPackageTask.new(spec) { |p| p.gem_spec = spec }
42
-
43
+
44
+ desc "Install dependencies for development."
45
+ task :setup do
46
+ gems = ::Gem::SourceIndex.from_installed_gems
47
+ spec.dependencies.each do |dep|
48
+ if gems.find_name(dep.name, dep.version_requirements).empty?
49
+ puts "Installing dependency: #{dep}"
50
+ system %Q|gem install #{dep.name} -v "#{dep.version_requirements}" --development|
51
+ end
52
+ end
53
+ end
54
+
43
55
  namespace :gem do
44
56
  desc "Repackage gem, uninstall and install again (does not use sudo)."
45
57
  task :refresh => :repackage do
@@ -12,7 +12,7 @@ module RStack
12
12
 
13
13
  desc "Run specs through RCov and generate HTML reports"
14
14
  ::Spec::Rake::SpecTask.new('spec:with_coverage') do |t|
15
- t.rcov_dir = configuration.outpath / 'coverage'
15
+ t.rcov_dir = File.join(configuration.outpath, 'coverage')
16
16
  t.spec_files = configuration.spec_files
17
17
  t.spec_opts = ["--format", "html:#{configuration.outpath}/spec_report.html", "--diff"]
18
18
  t.fail_on_error = false
@@ -2,7 +2,7 @@ module RStack #:nodoc:
2
2
  module Version #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -46,4 +46,5 @@ describe RStack::Configuration do
46
46
  it "should define a 'cruise' task" do
47
47
  Rake::Task.should be_task_defined("cruise")
48
48
  end
49
- end
49
+
50
+ end
@@ -15,7 +15,7 @@ describe RStack::Generator do
15
15
  end
16
16
 
17
17
  it "should have a path equal to the project name" do
18
- @generator.path.should == Pathname.new(@generator.project_name)
18
+ @generator.path.should == Pathname.new(@generator.project_name).expand_path
19
19
  end
20
20
 
21
21
  it "should have a pathized project name" do
@@ -27,15 +27,15 @@ describe RStack::Generator do
27
27
  end
28
28
 
29
29
  it "should have a lib path should include the elements of the dasherized project name" do
30
- @generator.paths[:lib].to_s.should == RStack.root.to_s / "foo/lib"
30
+ @generator.paths[:lib].should == RStack.root.join("foo/lib")
31
31
  end
32
32
 
33
33
  it "should have a main path that includes all the pathized elements but the last" do
34
- @generator.paths[:main].to_s.should == RStack.root.to_s / "foo/lib"
34
+ @generator.paths[:main].should == RStack.root.join("foo/lib")
35
35
  end
36
36
 
37
37
  it "should have a project path that includes the pathized elements" do
38
- @generator.paths[:project].to_s.should == RStack.root.to_s / "foo/lib/foo"
38
+ @generator.paths[:project].should == RStack.root.join("foo/lib/foo")
39
39
  end
40
40
  end
41
41
 
@@ -7,6 +7,6 @@ RStack::Configuration.new '#{project_name}' do |config|
7
7
  config.summary = '[ENTER A SUMMARY]'
8
8
  config.author = '#{author}'
9
9
  config.email = '[ENTER YOUR EMAIL]'
10
- config.url = '[ENTER A PROJECT URL]'
10
+ config.url = ''
11
11
  config.version = #{module_name}::Version::STRING
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jrun-rstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeremy burks
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-03 00:00:00 -07:00
12
+ date: 2009-07-24 00:00:00 -07:00
13
13
  default_executable: rstack
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,16 +22,6 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.8.1
24
24
  version:
25
- - !ruby/object:Gem::Dependency
26
- name: extlib
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
35
25
  - !ruby/object:Gem::Dependency
36
26
  name: rcov
37
27
  type: :development
@@ -71,64 +61,65 @@ extensions: []
71
61
  extra_rdoc_files: []
72
62
 
73
63
  files:
74
- - bin
64
+ - spec
75
65
  - lib
76
- - LICENSE.txt
77
- - Rakefile
78
66
  - README.textile
79
- - spec
80
67
  - templates
68
+ - bin
69
+ - Rakefile
81
70
  - vendor
71
+ - LICENSE.txt
82
72
  - bin/rstack
73
+ - lib/rstack.rb
83
74
  - lib/rstack
84
75
  - lib/rstack/configuration.rb
85
- - lib/rstack/generator.rb
86
76
  - lib/rstack/tasks
77
+ - lib/rstack/version.rb
78
+ - lib/rstack/generator.rb
79
+ - lib/rstack/core_ext.rb
80
+ - lib/rstack/tasks/rspec.rb
87
81
  - lib/rstack/tasks/doc.rb
88
82
  - lib/rstack/tasks/gem.rb
89
- - lib/rstack/tasks/rspec.rb
90
- - lib/rstack/version.rb
91
- - lib/rstack.rb
92
- - spec/configuration_spec.rb
93
- - spec/generator_spec.rb
94
83
  - spec/spec_helper.rb
84
+ - spec/configuration_spec.rb
95
85
  - spec/tasks
86
+ - spec/generator_spec.rb
96
87
  - spec/tasks/doc_spec.rb
88
+ - templates/spec_helper.rb
97
89
  - templates/cruise_config.rb
98
90
  - templates/main.rb
99
- - templates/Rakefile
100
- - templates/README.txt
101
- - templates/spec_helper.rb
102
91
  - templates/version.rb
92
+ - templates/README.txt
93
+ - templates/Rakefile
103
94
  - vendor/allison-2.0.2
104
- - vendor/allison-2.0.2/bin
105
- - vendor/allison-2.0.2/bin/allison
95
+ - vendor/allison-2.0.2/CHANGELOG
96
+ - vendor/allison-2.0.2/lib
97
+ - vendor/allison-2.0.2/Manifest
98
+ - vendor/allison-2.0.2/contrib
99
+ - vendor/allison-2.0.2/README
100
+ - vendor/allison-2.0.2/LICENSE
106
101
  - vendor/allison-2.0.2/cache
107
- - vendor/allison-2.0.2/cache/BODY
108
- - vendor/allison-2.0.2/cache/CLASS_INDEX
109
- - vendor/allison-2.0.2/cache/CLASS_PAGE
110
- - vendor/allison-2.0.2/cache/FILE_INDEX
111
- - vendor/allison-2.0.2/cache/FILE_PAGE
102
+ - vendor/allison-2.0.2/bin
103
+ - vendor/allison-2.0.2/lib/allison.css
104
+ - vendor/allison-2.0.2/lib/allison.rb
105
+ - vendor/allison-2.0.2/lib/allison.js
106
+ - vendor/allison-2.0.2/contrib/Rakefile
112
107
  - vendor/allison-2.0.2/cache/FONTS
113
108
  - vendor/allison-2.0.2/cache/FR_INDEX_BODY
109
+ - vendor/allison-2.0.2/cache/METHOD_INDEX
110
+ - vendor/allison-2.0.2/cache/FILE_PAGE
111
+ - vendor/allison-2.0.2/cache/PROJECT
114
112
  - vendor/allison-2.0.2/cache/INDEX
115
113
  - vendor/allison-2.0.2/cache/JAVASCRIPT
116
- - vendor/allison-2.0.2/cache/METHOD_INDEX
114
+ - vendor/allison-2.0.2/cache/FILE_INDEX
117
115
  - vendor/allison-2.0.2/cache/METHOD_LIST
118
- - vendor/allison-2.0.2/cache/PROJECT
119
116
  - vendor/allison-2.0.2/cache/SRC_PAGE
120
117
  - vendor/allison-2.0.2/cache/STYLE
121
- - vendor/allison-2.0.2/CHANGELOG
122
- - vendor/allison-2.0.2/contrib
123
- - vendor/allison-2.0.2/contrib/Rakefile
124
- - vendor/allison-2.0.2/lib
125
- - vendor/allison-2.0.2/lib/allison.css
126
- - vendor/allison-2.0.2/lib/allison.js
127
- - vendor/allison-2.0.2/lib/allison.rb
128
- - vendor/allison-2.0.2/LICENSE
129
- - vendor/allison-2.0.2/Manifest
130
- - vendor/allison-2.0.2/README
131
- has_rdoc: true
118
+ - vendor/allison-2.0.2/cache/CLASS_PAGE
119
+ - vendor/allison-2.0.2/cache/CLASS_INDEX
120
+ - vendor/allison-2.0.2/cache/BODY
121
+ - vendor/allison-2.0.2/bin/allison
122
+ has_rdoc: false
132
123
  homepage: http://github.com/jrun/rstack/wikis
133
124
  post_install_message:
134
125
  rdoc_options: []