arethusa-cli 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 217c5ae86d522ea8ac29f3156d9b550ad1fa375e
4
- data.tar.gz: 123fc0bca8f6823a192555b76e98126ab7dded3b
3
+ metadata.gz: afeb0ce53fd34fdf9cf6a74c80ea36134ff1fb07
4
+ data.tar.gz: fd43c5796af390d3b52bf6962eb53bce491bf0c9
5
5
  SHA512:
6
- metadata.gz: ebd2477b7d10ea17a75601ae85973d74eceb025825c889f536d7fcd6a8adf122215198ef682938f5c327b61240418395e60208fbf4cfb8a07f9f20525b35ab5d
7
- data.tar.gz: 079dd82eb262800464a8c28e927fe6bd7af0252582c51051e12cb19f7b1cf57ca1e65341ac67c2c5908fd756e483376709ba5d46b821d2efeec94540478337dd
6
+ metadata.gz: b09baa19fc86e6223d35b370b11fb05cee4e443cb2f94f3f115dd67328a1e7d80448ebbcddeb49a5824eaa2342d26814d7af490f7a435584a79eccb1ed9a8ae4
7
+ data.tar.gz: 1e6bd9bf6578367e4614ce740b6e9304fe25edf4ccccddd32cf9f7fea378c0f19ee2a8a56b72b1806ff462f484700ed21f726825220ef9bf72ebdc191972ee41
@@ -9,7 +9,7 @@ class Arethusa::CLI
9
9
  end
10
10
 
11
11
  include Thor::Actions
12
- attr_reader :namespace, :name
12
+ attr_reader :namespace
13
13
 
14
14
  desc 'plugin NAME', 'Creates a new Arethusa plugin skeleton'
15
15
  method_option :namespace, aliases: '-n', default: 'arethusa',
@@ -36,14 +36,28 @@ class Arethusa::CLI
36
36
  end
37
37
 
38
38
  no_commands do
39
+ def name(js = false)
40
+ if js
41
+ to_camelcase(@name)
42
+ else
43
+ @name
44
+ end
45
+ end
46
+
47
+ def to_camelcase(str)
48
+ parts = str.split('_')
49
+ first = parts.shift
50
+ "#{first}#{parts.map(&:capitalize).join}"
51
+ end
52
+
39
53
  def try(message, method)
40
54
  puts
41
55
  say_status('trying', "to #{message}...", :yellow)
42
56
  send(method)
43
57
  end
44
58
 
45
- def namespaced_name
46
- [namespace, name].compact.join('.')
59
+ def namespaced_name(js = false)
60
+ [namespace, name(js)].compact.join('.')
47
61
  end
48
62
 
49
63
  DIRECTORIES = %w{ plugin_dir template_dir }
@@ -71,7 +85,7 @@ class Arethusa::CLI
71
85
 
72
86
  def add_module
73
87
  insert_into_file(arethusa_main, before: /\n\]/, force: false) do
74
- ",\n '#{namespaced_name}'"
88
+ ",\n '#{namespaced_name(true)}'"
75
89
  end
76
90
  end
77
91
 
@@ -81,13 +95,13 @@ class Arethusa::CLI
81
95
 
82
96
  def add_minification
83
97
  insert_into_file(gruntfile, after: /pluginFiles\(.*?core.*?\).*?\n/, force: false) do
84
- %[ #{name}: { files: pluginFiles('#{namespaced_name}') },\n]
98
+ %[ #{name(true)}: { files: pluginFiles('#{namespaced_name}') },\n]
85
99
  end
86
100
  end
87
101
 
88
102
  def add_minification_task
89
103
  insert_into_file(gruntfile, after: /registerTask.*?minify.*?\n/, force: false) do
90
- %{ 'uglify:#{name}',\n}
104
+ %{ 'uglify:#{name(true)}',\n}
91
105
  end
92
106
  end
93
107
 
@@ -110,8 +124,8 @@ class Arethusa::CLI
110
124
  Now add your new #{name} plugin to a conf file and add a configuration for it.
111
125
  It could look like this:
112
126
 
113
- "#{name}" : {
114
- "name" : "#{name}",
127
+ "#{name(true)}" : {
128
+ "name" : "#{name(true)}",
115
129
  "template" : "#{html_template_file.slice(/template.*/)}"
116
130
  }
117
131
  EOF
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- angular.module('<%= namespaced_name %>', ['arethusa.core']);
2
+ angular.module('<%= namespaced_name(true) %>', ['arethusa.core']);
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
 
3
- angular.module('<%= namespaced_name %>').service('<%= name %>', [
3
+ angular.module('<%= namespaced_name(true) %>').service('<%= name(true) %>', [
4
4
  'state',
5
5
  'configurator',
6
6
  function(state, configurator) {
7
7
  var self = this;
8
8
 
9
9
  function configure() {
10
- configurator.getConfAndDelegate('<%= name %>', self);
10
+ configurator.getConfAndDelegate('<%= name(true) %>', self);
11
11
  }
12
12
 
13
13
  configure();
@@ -1,5 +1,5 @@
1
1
  module Arethusa
2
2
  class CLI
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arethusa-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LFDM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-29 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.2.2
130
+ rubygems_version: 2.2.0
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Command line tools for Arethusa