neptune_coffee 0.0.2 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3bf480ad75d53f487a64adf993fff7ad3392c54
4
- data.tar.gz: 17f93ddd45dd00c50289bf0723a6384e40a29f00
3
+ metadata.gz: cddf86c8945bc610d8cf38f4f7ba8bafa62a84d6
4
+ data.tar.gz: f4690c75025d2dbaf2d470bcb57f405d94fedbff
5
5
  SHA512:
6
- metadata.gz: a5cd0385135c576572689bf3afc7ac557e16ca0fa091bc42a4fe7da26860ef3fdead7596be370e356dd677a8ae7a4b811d137834629fd8e49f31c73323be9e15
7
- data.tar.gz: 6223ffaf80634ccd66ad3bf8dbe1f3a0c6a55ff055314359a7c31ac987908c95750a5910b65188982391b4e155f2d1c125dcdc5128355a49aa054b7ef02c1c0c
6
+ metadata.gz: b9184a51f6980940d3b326f7e45fc45637e40c7eac994030d66695f344a0ecd89ec780aafe7213af5f682b8ed23150af2a3485a651a53f6d96d78336bf5b1a99
7
+ data.tar.gz: 4272f120cb31e48f4f3b70315c213faa483029314e4e29c60114f5e4ff5672db039b8606a8ed892c8ccbba875a02433ec7726cd3ab70f3ea3546112e6ff9e85c
data/README.md CHANGED
@@ -21,11 +21,11 @@ NeptuneCoffee generates the .js files to define your AMD modules.
21
21
  NeptuneCoffee has an opinion about how you should organize your javascript for AMD modules. It is:
22
22
 
23
23
  * Directories are AMD modules
24
- * Directory names the AMD module names
25
- * Directory names snake_case
26
- * generated AMD module names are CamelCase
24
+ * Directory's name defines the AMD module's name
25
+ * Directory names should be snake_case
26
+ * generated AMD module names will be CamelCase
27
27
  * require "foo/bar" includes all files in the module defined by the directory "foo/bar"
28
- * Defines a global namespace for accessing AMD modules: window.Neptune.YourRootModule.YourSubModule
28
+ * Defines a hierachical namespace based on module names and directory structure nesting
29
29
 
30
30
  ## Benefit
31
31
 
data/bin/neptune_coffee CHANGED
@@ -10,13 +10,12 @@ NeptuneCoffee
10
10
  An opinionated javascript AMD module generator.
11
11
 
12
12
  For every $subdir, generates:
13
- $subdir/neptune.js // adds all sub-namespaces to $subdir's namespace object
14
13
  $subdir/namespace.js // defines $subdir's namespace object
15
14
  $subdir.js // loads all .js files in $subdir recursively
16
15
 
17
- * All three generated files return $subdir's namespace object.
18
- * Client's should require $subdir.js.
19
- * Source files in $subdir/ should require $subdir/neptune.js
16
+ * both generated files return $subdir's namespace object.
17
+ * Clients should require $subdir.js.
18
+ * Source files should require ./namespace.js
20
19
 
21
20
  Options:
22
21
  ENDBANNER
@@ -1,4 +1,4 @@
1
- // Generated by NeptuneCoffee 0.0.2
1
+ // Generated by NeptuneCoffee 0.1.0
2
2
  define([
3
3
  './solids/namespace'
4
4
  ], function(Solids) {
@@ -1,4 +1,4 @@
1
- // Generated by NeptuneCoffee 0.0.2
1
+ // Generated by NeptuneCoffee 0.1.0
2
2
  define([], function() {
3
3
  Solids = (function() {
4
4
  function Solids() {}
@@ -1,6 +1,6 @@
1
- // Generated by NeptuneCoffee 0.0.2
1
+ // Generated by NeptuneCoffee 0.1.0
2
2
  define([
3
- './solids/namespace'
3
+ './solids/namespace',
4
4
  './solids/cone'
5
5
  ], function(Solids) {
6
6
  return Solids;
@@ -1,8 +1,8 @@
1
- // Generated by NeptuneCoffee 0.0.2
1
+ // Generated by NeptuneCoffee 0.1.0
2
2
  define([
3
- './geometry/namespace'
4
- './geometry/box'
5
- './geometry/circle'
3
+ './geometry/namespace',
4
+ './geometry/box',
5
+ './geometry/circle',
6
6
  './geometry/solids'
7
7
  ], function(Geometry) {
8
8
  return Geometry;
@@ -1,4 +1,4 @@
1
- // Generated by NeptuneCoffee 0.0.2
1
+ // Generated by NeptuneCoffee 0.1.0
2
2
  define([
3
3
  './geometry/namespace'
4
4
  ], function(Geometry) {
@@ -7,7 +7,7 @@ module NeptuneCoffee
7
7
  end
8
8
 
9
9
  def define_js files, relative_to_path
10
- files_js = files.length == 0 ? "" : files.map{|f| "\n './#{f.relative_path_from(relative_to_path)}'"}.join + "\n"
10
+ files_js = files.length == 0 ? "" : files.map{|f| "\n './#{f.relative_path_from(relative_to_path)}'"}.join(",") + "\n"
11
11
  "define([#{files_js}], function"
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module NeptuneCoffee
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -22,10 +22,10 @@ describe JavascriptGenerator do
22
22
 
23
23
  module_js.should == <<ENDJS
24
24
  define([
25
- './bar/namespace'
26
- './bar/file1'
27
- './bar/file2'
28
- './bar/subdir1'
25
+ './bar/namespace',
26
+ './bar/file1',
27
+ './bar/file2',
28
+ './bar/subdir1',
29
29
  './bar/subdir2'
30
30
  ], function(Bar) {
31
31
  return Bar;
@@ -39,7 +39,7 @@ ENDJS
39
39
  ]
40
40
  namespace_js.should == <<ENDJS
41
41
  define([
42
- './sub_dir1/namespace'
42
+ './sub_dir1/namespace',
43
43
  './sub_dir2/namespace'
44
44
  ], function(SubDir1, SubDir2) {
45
45
  Bar = (function() {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neptune_coffee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Brinkman-Davis
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  version: '0'
166
166
  requirements: []
167
167
  rubyforge_project:
168
- rubygems_version: 2.0.3
168
+ rubygems_version: 2.0.7
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: NeptuneCoffee is an opinionated module generator. Modules and namespaces