coherent 0.4.1 → 0.4.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/VERSION +1 -1
- data/app_generators/coherent/templates/distil.yml.erb +1 -1
- data/app_generators/coherent/templates/src/js/@name@.js.erb +1 -1
- data/coherent.gemspec +14 -2
- data/demo_generators/gallery/templates/distil.yml.erb +1 -1
- data/demo_generators/gallery/templates/src/js/@name@.js.erb +1 -1
- data/demo_generators/gallery/templates/src/nibs/@name@/@name@.jsnib.erb +1 -1
- data/generators/class/templates/@name@.js.erb +1 -1
- data/generators/nib/templates/@name@.jsnib.erb +1 -1
- data/lib/plugin/repositories.rb +1 -1
- data/test/helper.rb +10 -0
- data/test/test_app_generator.rb +45 -0
- data/test/test_class_generator.rb +45 -0
- data/test/test_coherent_generator.rb +43 -0
- data/test/test_coherent_library_generator.rb +45 -0
- data/test/test_coherent_tools.rb +7 -0
- data/test/test_framework_generator.rb +45 -0
- data/test/test_gallery_sample_generator.rb +45 -0
- data/test/test_generator_helper.rb +29 -0
- data/test/test_nib_generator.rb +45 -0
- metadata +13 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
data/coherent.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{coherent}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jeff Watkins"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-04-01}
|
13
13
|
s.default_executable = %q{coherent}
|
14
14
|
s.description = %q{Tools for building Coherent application or modules.}
|
15
15
|
s.email = %q{jeff@metrocat.org}
|
@@ -88,6 +88,18 @@ Gem::Specification.new do |s|
|
|
88
88
|
s.require_paths = ["lib"]
|
89
89
|
s.rubygems_version = %q{1.3.5}
|
90
90
|
s.summary = %q{Tools for building Coherent application or modules.}
|
91
|
+
s.test_files = [
|
92
|
+
"test/helper.rb",
|
93
|
+
"test/test_app_generator.rb",
|
94
|
+
"test/test_class_generator.rb",
|
95
|
+
"test/test_coherent_generator.rb",
|
96
|
+
"test/test_coherent_library_generator.rb",
|
97
|
+
"test/test_coherent_tools.rb",
|
98
|
+
"test/test_framework_generator.rb",
|
99
|
+
"test/test_gallery_sample_generator.rb",
|
100
|
+
"test/test_generator_helper.rb",
|
101
|
+
"test/test_nib_generator.rb"
|
102
|
+
]
|
91
103
|
|
92
104
|
if s.respond_to? :specification_version then
|
93
105
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
data/lib/plugin/repositories.rb
CHANGED
data/test/helper.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
|
4
|
+
class TestAppGenerator < Test::Unit::TestCase
|
5
|
+
include RubiGen::GeneratorTestHelper
|
6
|
+
|
7
|
+
def setup
|
8
|
+
bare_setup
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
bare_teardown
|
13
|
+
end
|
14
|
+
|
15
|
+
# Some generator-related assertions:
|
16
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
17
|
+
# assert_directory_exists(name)
|
18
|
+
# assert_generated_class(name, &block)
|
19
|
+
# assert_generated_module(name, &block)
|
20
|
+
# assert_generated_test_for(name, &block)
|
21
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
22
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
23
|
+
#
|
24
|
+
# Other helper methods are:
|
25
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
26
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
27
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
28
|
+
|
29
|
+
def test_generator_without_options
|
30
|
+
name = "myapp"
|
31
|
+
run_generator('app', [name], sources)
|
32
|
+
assert_directory_exists "some/directory"
|
33
|
+
assert_generated_file "some_file"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def sources
|
38
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
def generator_path
|
43
|
+
"generators"
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
|
4
|
+
class TestClassGenerator < Test::Unit::TestCase
|
5
|
+
include RubiGen::GeneratorTestHelper
|
6
|
+
|
7
|
+
def setup
|
8
|
+
bare_setup
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
bare_teardown
|
13
|
+
end
|
14
|
+
|
15
|
+
# Some generator-related assertions:
|
16
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
17
|
+
# assert_directory_exists(name)
|
18
|
+
# assert_generated_class(name, &block)
|
19
|
+
# assert_generated_module(name, &block)
|
20
|
+
# assert_generated_test_for(name, &block)
|
21
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
22
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
23
|
+
#
|
24
|
+
# Other helper methods are:
|
25
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
26
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
27
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
28
|
+
|
29
|
+
def test_generator_without_options
|
30
|
+
name = "myapp"
|
31
|
+
run_generator('class', [name], sources)
|
32
|
+
assert_directory_exists "some/directory"
|
33
|
+
assert_generated_file "some_file"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def sources
|
38
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
def generator_path
|
43
|
+
"generators"
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
class TestCoherentBaseGenerator < Test::Unit::TestCase
|
4
|
+
include RubiGen::GeneratorTestHelper
|
5
|
+
|
6
|
+
def setup
|
7
|
+
bare_setup
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
bare_teardown
|
12
|
+
end
|
13
|
+
|
14
|
+
# Some generator-related assertions:
|
15
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
16
|
+
# assert_directory_exists(name)
|
17
|
+
# assert_generated_class(name, &block)
|
18
|
+
# assert_generated_module(name, &block)
|
19
|
+
# assert_generated_test_for(name, &block)
|
20
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
21
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
22
|
+
#
|
23
|
+
# Other helper methods are:
|
24
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
25
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
26
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
27
|
+
|
28
|
+
def test_generator_without_options
|
29
|
+
run_generator('coherent', [APP_ROOT], sources)
|
30
|
+
assert_directory_exists "path/to/included/folder"
|
31
|
+
assert_generated_file "path/to/included/folder/some_file"
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
def sources
|
36
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
37
|
+
]
|
38
|
+
end
|
39
|
+
|
40
|
+
def generator_path
|
41
|
+
"app_generators"
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
|
4
|
+
class TestCoherentLibraryGenerator < Test::Unit::TestCase
|
5
|
+
include RubiGen::GeneratorTestHelper
|
6
|
+
|
7
|
+
def setup
|
8
|
+
bare_setup
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
bare_teardown
|
13
|
+
end
|
14
|
+
|
15
|
+
# Some generator-related assertions:
|
16
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
17
|
+
# assert_directory_exists(name)
|
18
|
+
# assert_generated_class(name, &block)
|
19
|
+
# assert_generated_module(name, &block)
|
20
|
+
# assert_generated_test_for(name, &block)
|
21
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
22
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
23
|
+
#
|
24
|
+
# Other helper methods are:
|
25
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
26
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
27
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
28
|
+
|
29
|
+
def test_generator_without_options
|
30
|
+
name = "myapp"
|
31
|
+
run_generator('coherent_library', [name], sources)
|
32
|
+
assert_directory_exists "some/directory"
|
33
|
+
assert_generated_file "some_file"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def sources
|
38
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
def generator_path
|
43
|
+
"generators"
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
|
4
|
+
class TestFrameworkGenerator < Test::Unit::TestCase
|
5
|
+
include RubiGen::GeneratorTestHelper
|
6
|
+
|
7
|
+
def setup
|
8
|
+
bare_setup
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
bare_teardown
|
13
|
+
end
|
14
|
+
|
15
|
+
# Some generator-related assertions:
|
16
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
17
|
+
# assert_directory_exists(name)
|
18
|
+
# assert_generated_class(name, &block)
|
19
|
+
# assert_generated_module(name, &block)
|
20
|
+
# assert_generated_test_for(name, &block)
|
21
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
22
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
23
|
+
#
|
24
|
+
# Other helper methods are:
|
25
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
26
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
27
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
28
|
+
|
29
|
+
def test_generator_without_options
|
30
|
+
name = "myapp"
|
31
|
+
run_generator('framework', [name], sources)
|
32
|
+
assert_directory_exists "some/directory"
|
33
|
+
assert_generated_file "some_file"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def sources
|
38
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
def generator_path
|
43
|
+
"generators"
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
|
4
|
+
class TestGallerySampleGenerator < Test::Unit::TestCase
|
5
|
+
include RubiGen::GeneratorTestHelper
|
6
|
+
|
7
|
+
def setup
|
8
|
+
bare_setup
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
bare_teardown
|
13
|
+
end
|
14
|
+
|
15
|
+
# Some generator-related assertions:
|
16
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
17
|
+
# assert_directory_exists(name)
|
18
|
+
# assert_generated_class(name, &block)
|
19
|
+
# assert_generated_module(name, &block)
|
20
|
+
# assert_generated_test_for(name, &block)
|
21
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
22
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
23
|
+
#
|
24
|
+
# Other helper methods are:
|
25
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
26
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
27
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
28
|
+
|
29
|
+
def test_generator_without_options
|
30
|
+
name = "myapp"
|
31
|
+
run_generator('gallery_sample', [name], sources)
|
32
|
+
assert_directory_exists "some/directory"
|
33
|
+
assert_generated_file "some_file"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def sources
|
38
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
def generator_path
|
43
|
+
"generators"
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
begin
|
2
|
+
require File.dirname(__FILE__) + '/test_helper'
|
3
|
+
rescue LoadError
|
4
|
+
require 'test/unit'
|
5
|
+
end
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
# Must set before requiring generator libs.
|
9
|
+
TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT)
|
10
|
+
PROJECT_NAME = "myproject" unless defined?(PROJECT_NAME)
|
11
|
+
app_root = File.join(TMP_ROOT, PROJECT_NAME)
|
12
|
+
if defined?(APP_ROOT)
|
13
|
+
APP_ROOT.replace(app_root)
|
14
|
+
else
|
15
|
+
APP_ROOT = app_root
|
16
|
+
end
|
17
|
+
if defined?(RAILS_ROOT)
|
18
|
+
RAILS_ROOT.replace(app_root)
|
19
|
+
else
|
20
|
+
RAILS_ROOT = app_root
|
21
|
+
end
|
22
|
+
|
23
|
+
begin
|
24
|
+
require 'rubigen'
|
25
|
+
rescue LoadError
|
26
|
+
require 'rubygems'
|
27
|
+
require 'rubigen'
|
28
|
+
end
|
29
|
+
require 'rubigen/helpers/generator_test_helper'
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
|
2
|
+
|
3
|
+
|
4
|
+
class TestNibGenerator < Test::Unit::TestCase
|
5
|
+
include RubiGen::GeneratorTestHelper
|
6
|
+
|
7
|
+
def setup
|
8
|
+
bare_setup
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
bare_teardown
|
13
|
+
end
|
14
|
+
|
15
|
+
# Some generator-related assertions:
|
16
|
+
# assert_generated_file(name, &block) # block passed the file contents
|
17
|
+
# assert_directory_exists(name)
|
18
|
+
# assert_generated_class(name, &block)
|
19
|
+
# assert_generated_module(name, &block)
|
20
|
+
# assert_generated_test_for(name, &block)
|
21
|
+
# The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
|
22
|
+
# assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
|
23
|
+
#
|
24
|
+
# Other helper methods are:
|
25
|
+
# app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
|
26
|
+
# bare_setup - place this in setup method to create the APP_ROOT folder for each test
|
27
|
+
# bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
|
28
|
+
|
29
|
+
def test_generator_without_options
|
30
|
+
name = "myapp"
|
31
|
+
run_generator('nib', [name], sources)
|
32
|
+
assert_directory_exists "some/directory"
|
33
|
+
assert_generated_file "some_file"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def sources
|
38
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
def generator_path
|
43
|
+
"generators"
|
44
|
+
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coherent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Watkins
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-04-01 00:00:00 -07:00
|
13
13
|
default_executable: coherent
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -133,5 +133,14 @@ rubygems_version: 1.3.5
|
|
133
133
|
signing_key:
|
134
134
|
specification_version: 3
|
135
135
|
summary: Tools for building Coherent application or modules.
|
136
|
-
test_files:
|
137
|
-
|
136
|
+
test_files:
|
137
|
+
- test/helper.rb
|
138
|
+
- test/test_app_generator.rb
|
139
|
+
- test/test_class_generator.rb
|
140
|
+
- test/test_coherent_generator.rb
|
141
|
+
- test/test_coherent_library_generator.rb
|
142
|
+
- test/test_coherent_tools.rb
|
143
|
+
- test/test_framework_generator.rb
|
144
|
+
- test/test_gallery_sample_generator.rb
|
145
|
+
- test/test_generator_helper.rb
|
146
|
+
- test/test_nib_generator.rb
|