andhapp-decoct 1.0.0 → 1.1.0
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/Rakefile +13 -35
- data/VERSION.yml +4 -4
- data/bin/decoct +3 -10
- data/decoct.gemspec +7 -2
- data/lib/dscript.rb +20 -9
- data/lib/templates/.autotest +2 -0
- data/lib/templates/generic_app.rb +7 -0
- data/lib/templates/spec/rcov.opts +2 -0
- data/lib/templates/spec/spec.opts +4 -0
- data/lib/templates/spec/spec_helper.rb +38 -0
- data/test/ts_script.rb +1 -1
- metadata +7 -2
data/Rakefile
CHANGED
@@ -4,42 +4,20 @@
|
|
4
4
|
|
5
5
|
begin
|
6
6
|
require 'jeweler'
|
7
|
-
Jeweler::Tasks.new do |
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.name = "decoct"
|
9
|
+
gem.summary = "Its a simple gem which creates a project structure for sinatra to work with rspec, ZenTest, Snarl(on Windows), RedGreen, Rcov"
|
10
|
+
gem.email = "anuj@andhapp.com"
|
11
|
+
gem.homepage = "http://github.com/andhapp/decoct"
|
12
|
+
gem.description = "Sinatra Rspec project generator"
|
13
|
+
gem.authors = ["Anuj Dutta"]
|
14
|
+
gem.files.include %w(lib/templates/.autotest)
|
15
|
+
gem.add_dependency 'rspec'
|
16
|
+
gem.add_dependency 'ZenTest'
|
17
|
+
gem.add_dependency 'ruby-snarl'
|
18
|
+
gem.add_dependency 'redgreen'
|
19
|
+
gem.add_dependency 'rcov'
|
19
20
|
end
|
20
21
|
rescue LoadError
|
21
22
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
22
23
|
end
|
23
|
-
|
24
|
-
Rake::TestTask.new do |t|
|
25
|
-
t.libs << 'lib'
|
26
|
-
t.pattern = 'test/**/*_test.rb'
|
27
|
-
t.verbose = false
|
28
|
-
end
|
29
|
-
|
30
|
-
Rake::RDocTask.new do |rdoc|
|
31
|
-
rdoc.rdoc_dir = 'rdoc'
|
32
|
-
rdoc.title = 'Jeweler'
|
33
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
34
|
-
rdoc.rdoc_files.include('README*')
|
35
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
36
|
-
end
|
37
|
-
|
38
|
-
Rcov::RcovTask.new do |t|
|
39
|
-
t.libs << "test"
|
40
|
-
t.test_files = FileList['test/*_test.rb']
|
41
|
-
t.verbose = true
|
42
|
-
end
|
43
|
-
|
44
|
-
task :default => :rcov
|
45
|
-
|
data/VERSION.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
---
|
2
|
-
:patch: 0
|
3
|
-
:major: 1
|
4
|
-
:minor:
|
1
|
+
---
|
2
|
+
:patch: 0
|
3
|
+
:major: 1
|
4
|
+
:minor: 1
|
data/bin/decoct
CHANGED
@@ -1,14 +1,7 @@
|
|
1
1
|
app_path = ARGV.first
|
2
2
|
|
3
|
-
|
3
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
4
4
|
require 'dscript'
|
5
5
|
|
6
|
-
Dedoct::Dscript.new(app_path)
|
7
|
-
|
8
|
-
Dedoct::Dscript.create_lib
|
9
|
-
Dedoct::Dscript.create_spec
|
10
|
-
Dedoct::Dscript.create_views
|
11
|
-
Dedoct::Dscript.create_public
|
12
|
-
Dedoct::Dscript.copy_autotest_file
|
13
|
-
Dedoct::Dscript.copy_rspec_files
|
14
|
-
Dedoct::Dscript.create_app_file
|
6
|
+
dedoct = Dedoct::Dscript.new(app_path)
|
7
|
+
dedoct.run
|
data/decoct.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{decoct}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.1.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Anuj Dutta"]
|
9
|
-
s.date = %q{2009-04-
|
9
|
+
s.date = %q{2009-04-22}
|
10
10
|
s.default_executable = %q{decoct}
|
11
11
|
s.description = %q{Sinatra Rspec project generator}
|
12
12
|
s.email = %q{anuj@andhapp.com}
|
@@ -22,6 +22,11 @@ Gem::Specification.new do |s|
|
|
22
22
|
"decoct.gemspec",
|
23
23
|
"lib/dconstants.rb",
|
24
24
|
"lib/dscript.rb",
|
25
|
+
"lib/templates/.autotest",
|
26
|
+
"lib/templates/generic_app.rb",
|
27
|
+
"lib/templates/spec/rcov.opts",
|
28
|
+
"lib/templates/spec/spec.opts",
|
29
|
+
"lib/templates/spec/spec_helper.rb",
|
25
30
|
"test/templates/generic_app.rb",
|
26
31
|
"test/templates/spec/rcov.opts",
|
27
32
|
"test/templates/spec/spec.opts",
|
data/lib/dscript.rb
CHANGED
@@ -8,7 +8,7 @@ module Dedoct
|
|
8
8
|
# move the creation into a module and just include that module
|
9
9
|
class Dscript
|
10
10
|
|
11
|
-
|
11
|
+
attr_accessor :app_name
|
12
12
|
|
13
13
|
def initialize(app_name)
|
14
14
|
fail "app name cannot be nil or empty!!!" if app_name.eql?(nil) || app_name.empty?
|
@@ -16,7 +16,14 @@ module Dedoct
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def run
|
19
|
-
create_app_dir
|
19
|
+
create_app_dir
|
20
|
+
create_lib
|
21
|
+
create_spec
|
22
|
+
create_views
|
23
|
+
create_public
|
24
|
+
copy_autotest_file
|
25
|
+
copy_rspec_files
|
26
|
+
create_app_file
|
20
27
|
end
|
21
28
|
|
22
29
|
def create_lib
|
@@ -36,29 +43,33 @@ module Dedoct
|
|
36
43
|
end
|
37
44
|
|
38
45
|
def copy_autotest_file
|
39
|
-
|
46
|
+
copy_file("templates/.autotest", "#{app_name}/.autotest")
|
40
47
|
end
|
41
48
|
|
42
49
|
def copy_rspec_files
|
43
|
-
|
44
|
-
|
45
|
-
|
50
|
+
copy_file("templates/spec/spec.opts", "#{app_name}/spec/spec.opts")
|
51
|
+
copy_file("templates/spec/rcov.opts", "#{app_name}/spec/rcov.opts")
|
52
|
+
copy_file("templates/spec/spec_helper.rb", "#{app_name}/spec/spec_helper.rb")
|
46
53
|
end
|
47
54
|
|
48
55
|
def create_app_file
|
49
|
-
|
56
|
+
copy_file("templates/generic_app.rb", "#{app_name}/#{app_name}.rb")
|
50
57
|
end
|
51
|
-
|
52
|
-
private
|
53
58
|
|
54
59
|
def create_app_dir
|
55
60
|
create_dir
|
56
61
|
end
|
62
|
+
|
63
|
+
private
|
57
64
|
|
58
65
|
def create_dir(value = '')
|
59
66
|
Dir.mkdir("#{app_name}/#{value}")
|
60
67
|
end
|
61
68
|
|
69
|
+
def copy_file(from, to)
|
70
|
+
File.copy(from, to)
|
71
|
+
end
|
72
|
+
|
62
73
|
end
|
63
74
|
|
64
75
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
2
|
+
# from the project root directory.
|
3
|
+
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
|
4
|
+
require 'spec/autorun'
|
5
|
+
|
6
|
+
Spec::Runner.configure do |config|
|
7
|
+
# == Fixtures
|
8
|
+
#
|
9
|
+
# You can declare fixtures for each example_group like this:
|
10
|
+
# describe "...." do
|
11
|
+
# fixtures :table_a, :table_b
|
12
|
+
#
|
13
|
+
# Alternatively, if you prefer to declare them only once, you can
|
14
|
+
# do so right here. Just uncomment the next line and replace the fixture
|
15
|
+
# names with your fixtures.
|
16
|
+
#
|
17
|
+
# config.global_fixtures = :table_a, :table_b
|
18
|
+
#
|
19
|
+
# If you declare global fixtures, be aware that they will be declared
|
20
|
+
# for all of your examples, even those that don't use them.
|
21
|
+
#
|
22
|
+
# You can also declare which fixtures to use (for example fixtures for test/fixtures):
|
23
|
+
#
|
24
|
+
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
|
25
|
+
#
|
26
|
+
# == Mock Framework
|
27
|
+
#
|
28
|
+
# RSpec uses it's own mocking framework by default. If you prefer to
|
29
|
+
# use mocha, flexmock or RR, uncomment the appropriate line:
|
30
|
+
#
|
31
|
+
# config.mock_with :mocha
|
32
|
+
# config.mock_with :flexmock
|
33
|
+
# config.mock_with :rr
|
34
|
+
#
|
35
|
+
# == Notes
|
36
|
+
#
|
37
|
+
# For more information take a look at Spec::Runner::Configuration and Spec::Runner
|
38
|
+
end
|
data/test/ts_script.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: andhapp-decoct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anuj Dutta
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-22 00:00:00 -07:00
|
13
13
|
default_executable: decoct
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -78,6 +78,11 @@ files:
|
|
78
78
|
- decoct.gemspec
|
79
79
|
- lib/dconstants.rb
|
80
80
|
- lib/dscript.rb
|
81
|
+
- lib/templates/.autotest
|
82
|
+
- lib/templates/generic_app.rb
|
83
|
+
- lib/templates/spec/rcov.opts
|
84
|
+
- lib/templates/spec/spec.opts
|
85
|
+
- lib/templates/spec/spec_helper.rb
|
81
86
|
- test/templates/generic_app.rb
|
82
87
|
- test/templates/spec/rcov.opts
|
83
88
|
- test/templates/spec/spec.opts
|