neptune_coffee 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/bin/neptune_coffee +2 -2
- data/examples/after/geometry/namespace.js +3 -2
- data/examples/after/geometry/solids/namespace.js +3 -2
- data/examples/after/geometry/solids.js +2 -1
- data/examples/after/geometry.js +2 -1
- data/examples/after/namespace.js +3 -2
- data/lib/neptune_coffee/generator.rb +8 -5
- data/lib/neptune_coffee/javascript_generator.rb +1 -1
- data/lib/neptune_coffee/version.rb +1 -1
- data/spec/javascript_generator_spec.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53604b2fe8b4a5fa18945fe67425c6a59f5d495a
|
4
|
+
data.tar.gz: 6e597cdee37fbea92e38834492b9b02c15fab57d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efeae7c0df0a72f89aada7c2b255510292b3a5d299dcc50a7dae3ee7a2d1e8c1cb51aa4fbc763a869b586e56cfc42a33ec681f502d691246e5b95ff6b21da105
|
7
|
+
data.tar.gz: 30b3677e4e67aa96f650e93384f2f678834ca62b48a904c227105016896dd8cfbdd647436356e527697477d749c5fd0dc93bdde1ab02d76d27b25329abf13f25
|
data/CHANGELOG.md
ADDED
data/bin/neptune_coffee
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
|
-
|
2
|
+
puts "Start"
|
3
3
|
require 'trollop'
|
4
4
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','lib','neptune_coffee'))
|
5
5
|
|
6
6
|
options = Trollop::options ARGV do
|
7
7
|
banner <<ENDBANNER
|
8
|
-
NeptuneCoffee
|
8
|
+
NeptuneCoffee v#{NeptuneCoffee::VERSION}
|
9
9
|
|
10
10
|
An opinionated javascript AMD module generator.
|
11
11
|
|
@@ -1,8 +1,9 @@
|
|
1
|
-
// Generated by NeptuneCoffee 0.2.
|
1
|
+
// Generated by NeptuneCoffee 0.2.2
|
2
|
+
// path: geometry/namespace.js
|
2
3
|
define([
|
3
4
|
'./solids/namespace'
|
4
5
|
], function(Solids) {
|
5
|
-
Geometry = (function() {
|
6
|
+
var Geometry = (function() {
|
6
7
|
function Geometry() {}
|
7
8
|
return Geometry;
|
8
9
|
})();
|
data/examples/after/geometry.js
CHANGED
data/examples/after/namespace.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
// Generated by NeptuneCoffee 0.2.
|
1
|
+
// Generated by NeptuneCoffee 0.2.2
|
2
|
+
// path: namespace.js
|
2
3
|
define([
|
3
4
|
'./geometry/namespace'
|
4
5
|
], function(Geometry) {
|
5
|
-
Neptune = (function() {
|
6
|
+
var Neptune = (function() {
|
6
7
|
function Neptune() {}
|
7
8
|
return Neptune;
|
8
9
|
})();
|
@@ -7,13 +7,13 @@ module NeptuneCoffee
|
|
7
7
|
class Generator
|
8
8
|
attr_accessor :generated_files, :to_generate_files, :current_files, :skipped_files
|
9
9
|
attr_accessor :dirs, :force, :verbose, :quiet, :overwrite
|
10
|
+
attr_reader :root
|
10
11
|
|
11
12
|
SAFE_GENERATE_FIRST_LINE = "// Generated by NeptuneCoffee"
|
12
13
|
|
13
14
|
def initialize(options)
|
14
15
|
raise ArgumentError.new(":root option required, must be a string and valid path") unless Pathname.new(options[:root]).directory?
|
15
|
-
@
|
16
|
-
@dirs.add_all
|
16
|
+
@root = Pathname.new options[:root]
|
17
17
|
@force = options[:force]
|
18
18
|
@verbose = options[:verbose]
|
19
19
|
@overwrite = options[:overwrite]
|
@@ -21,8 +21,9 @@ module NeptuneCoffee
|
|
21
21
|
reset_file_info
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
@dirs.root
|
24
|
+
def load_dirs
|
25
|
+
@dirs = SimpleDirectoryStructure.new @root
|
26
|
+
@dirs.add_all
|
26
27
|
end
|
27
28
|
|
28
29
|
def warning(message) Guard::UI.warning "NeptuneCoffee: "+message unless @quiet; end
|
@@ -39,6 +40,7 @@ module NeptuneCoffee
|
|
39
40
|
|
40
41
|
def generate_all
|
41
42
|
reset_file_info
|
43
|
+
load_dirs
|
42
44
|
success "generating all files in: #{root}"
|
43
45
|
success "#{@dirs.length} directories found"
|
44
46
|
|
@@ -69,7 +71,8 @@ module NeptuneCoffee
|
|
69
71
|
info_file = file #join @root, file.split(@root)[-1]
|
70
72
|
if @overwrite || file_was_generated_by_neptune_coffee(file)
|
71
73
|
|
72
|
-
new_contents = SAFE_GENERATE_FIRST_LINE + " #{NeptuneCoffee::VERSION}\n" +
|
74
|
+
new_contents = SAFE_GENERATE_FIRST_LINE + " #{NeptuneCoffee::VERSION}\n" +
|
75
|
+
"// path: #{file.relative_path_from @root}\n" + yield
|
73
76
|
|
74
77
|
if @force || !file.exist? || file.read != new_contents
|
75
78
|
@generated_files[file] = true
|
@@ -45,7 +45,7 @@ define([
|
|
45
45
|
'./sub_dir1/namespace',
|
46
46
|
'./sub_dir2/namespace'
|
47
47
|
], function(SubDir1, SubDir2) {
|
48
|
-
Bar = (function() {
|
48
|
+
var Bar = (function() {
|
49
49
|
function Bar() {}
|
50
50
|
return Bar;
|
51
51
|
})();
|
@@ -60,7 +60,7 @@ ENDJS
|
|
60
60
|
namespace_js = JavascriptGenerator.new(Pathname["foo"], Pathname["foo/bar"]).namespace []
|
61
61
|
namespace_js.should == <<ENDJS
|
62
62
|
define([], function() {
|
63
|
-
Bar = (function() {
|
63
|
+
var Bar = (function() {
|
64
64
|
function Bar() {}
|
65
65
|
return Bar;
|
66
66
|
})();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neptune_coffee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Brinkman-Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trollop
|
@@ -117,6 +117,7 @@ extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
119
|
- .gitignore
|
120
|
+
- CHANGELOG.md
|
120
121
|
- Gemfile
|
121
122
|
- LICENSE.txt
|
122
123
|
- README.md
|