neptune_coffee 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66c47955d9f4f7c61196d9ebfd93b28685cb5245
4
- data.tar.gz: a349b48feed11d4ff8b57ef448e39942f987bcea
3
+ metadata.gz: 53604b2fe8b4a5fa18945fe67425c6a59f5d495a
4
+ data.tar.gz: 6e597cdee37fbea92e38834492b9b02c15fab57d
5
5
  SHA512:
6
- metadata.gz: ec430a0759d0b17964bdc57b0cc810a65036048d0a6a4aff2c62d0691997739dd76e05c61be071b5ea487492e08f4a62c9dd29ea4f9f557859e8b9ccbff7efae
7
- data.tar.gz: b147d1d105f107af09d10be2fb743dec82c1464396bee603c7eab5910188a84fbf4c657e07fe474bd15ab12cfedac2cc88d80b153d775183c5460471e839518a
6
+ metadata.gz: efeae7c0df0a72f89aada7c2b255510292b3a5d299dcc50a7dae3ee7a2d1e8c1cb51aa4fbc763a869b586e56cfc42a33ec681f502d691246e5b95ff6b21da105
7
+ data.tar.gz: 30b3677e4e67aa96f650e93384f2f678834ca62b48a904c227105016896dd8cfbdd647436356e527697477d749c5fd0dc93bdde1ab02d76d27b25329abf13f25
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Neptune Coffee Changelog
2
+
3
+ ### v0.2.2
4
+
5
+ * Added "// path:" comment to each generated file to make debugging easier. "What namespace.js file is this?"
6
+ * Stopped globbering global properties: Added "var" before variable creation in namespace.js files.
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.0
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
  })();
@@ -1,6 +1,7 @@
1
- // Generated by NeptuneCoffee 0.2.0
1
+ // Generated by NeptuneCoffee 0.2.2
2
+ // path: geometry/solids/namespace.js
2
3
  define([], function() {
3
- Solids = (function() {
4
+ var Solids = (function() {
4
5
  function Solids() {}
5
6
  return Solids;
6
7
  })();
@@ -1,4 +1,5 @@
1
- // Generated by NeptuneCoffee 0.2.0
1
+ // Generated by NeptuneCoffee 0.2.2
2
+ // path: geometry/solids.js
2
3
  define([
3
4
  './solids/namespace',
4
5
  './solids/cone'
@@ -1,4 +1,5 @@
1
- // Generated by NeptuneCoffee 0.2.0
1
+ // Generated by NeptuneCoffee 0.2.2
2
+ // path: geometry.js
2
3
  define([
3
4
  './geometry/namespace',
4
5
  './geometry/box',
@@ -1,8 +1,9 @@
1
- // Generated by NeptuneCoffee 0.2.0
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
- @dirs = SimpleDirectoryStructure.new options[:root]
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 root
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" + yield
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
@@ -40,7 +40,7 @@ ENDJS
40
40
 
41
41
  <<-ENDJS
42
42
  #{define_js sub_namespace_files, dir}(#{sub_namespaces.join ', '}) {
43
- #{namespace_name} = (function() {
43
+ var #{namespace_name} = (function() {
44
44
  function #{namespace_name}() {}
45
45
  return #{namespace_name};
46
46
  })();#{
@@ -1,3 +1,3 @@
1
1
  module NeptuneCoffee
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -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.0
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-02-04 00:00:00.000000000 Z
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