rugular 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bower.json +24 -0
- data/features/abstract.feature +16 -0
- data/features/generator_for_directive.feature +4 -11
- data/features/generator_for_route.feature +0 -7
- data/features/support/env.rb +4 -0
- data/lib/rugular/tasks/abstract.rb +101 -0
- data/lib/rugular/tasks/build.rb +2 -2
- data/lib/rugular/tasks/dependencies.rb +12 -3
- data/lib/rugular/tasks/generate/generator_base.rb +2 -11
- data/lib/rugular/tasks/generate/route.rb +3 -0
- data/lib/rugular/tasks/generate.rb +0 -1
- data/lib/rugular/tasks/helpers/javascript_files.rb +11 -12
- data/lib/rugular/tasks/new.rb +8 -2
- data/lib/rugular/tasks/server.rb +0 -7
- data/lib/rugular/templates/abstract/bower.json.erb +27 -0
- data/lib/rugular/templates/new/src/app/app.sass +3 -1
- data/lib/rugular/version.rb +1 -1
- data/lib/rugular.rb +7 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7099d451fdd136f5a26b0cbe6e04e64c4940322
|
4
|
+
data.tar.gz: 309bba88c6626df17d747674c598ee744a86f5ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc504f5b80f7d2efd7eed75820e68664b9be58fd72b1514d5bbe92ad26224e49957b89036303104e6fa72ccce615da02bb6c96356174d38fcded6f8ee082ed48
|
7
|
+
data.tar.gz: ab2ab46caec4137da0197f5269ed9d2b1eb0cd06bf1f84dbd30247a0179f2de0a9c2acb2c86375925c11b2a25d526e496d6a0bac570fb20a27783d91021ca78d
|
data/bower.json
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"name": "rar",
|
3
|
+
"version": "0.0.0",
|
4
|
+
"authors": [
|
5
|
+
"Nicholas Shook <nshook@q-centrix.com>"
|
6
|
+
],
|
7
|
+
"description": "yes",
|
8
|
+
"main": "okay.js",
|
9
|
+
"moduleType": [
|
10
|
+
"es6"
|
11
|
+
],
|
12
|
+
"keywords": [
|
13
|
+
"yes"
|
14
|
+
],
|
15
|
+
"license": "MIT",
|
16
|
+
"private": true,
|
17
|
+
"ignore": [
|
18
|
+
"**/.*",
|
19
|
+
"node_modules",
|
20
|
+
"bower_components",
|
21
|
+
"test",
|
22
|
+
"tests"
|
23
|
+
]
|
24
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
@increase_wait_time
|
2
|
+
Feature: Rugular CLI
|
3
|
+
In order to abstract bower components
|
4
|
+
As a user of the rugular framework
|
5
|
+
I want to create a bower_component from any component folder
|
6
|
+
|
7
|
+
Scenario: Abstract
|
8
|
+
When I set up Rugular and run "rugular g directive test"
|
9
|
+
And I run `cd tmp/aruba/my-app && rugular abstract test` interactively
|
10
|
+
And I type 'yes'
|
11
|
+
Then the file "~/bower_components/test/bower.json" should contain:
|
12
|
+
"""
|
13
|
+
"private": true,
|
14
|
+
"""
|
15
|
+
|
16
|
+
|
@@ -5,15 +5,15 @@ Feature: Rugular CLI
|
|
5
5
|
|
6
6
|
Scenario: Generating a route
|
7
7
|
When I set up Rugular and run "rugular generate directive test"
|
8
|
-
|
8
|
+
Then the file "my-app/src/components/test/test.directive.coffee" should contain:
|
9
9
|
"""
|
10
10
|
angular.module('test').directive('test', test)
|
11
11
|
"""
|
12
|
-
And the file "my-app/src/
|
12
|
+
And the file "my-app/src/components/test/test.directive.spec.coffee" should contain:
|
13
13
|
"""
|
14
14
|
describe 'testController', ->
|
15
15
|
"""
|
16
|
-
And the file "my-app/src/
|
16
|
+
And the file "my-app/src/components/test/test.haml" should contain:
|
17
17
|
"""
|
18
18
|
%h1 test
|
19
19
|
"""
|
@@ -21,15 +21,8 @@ Feature: Rugular CLI
|
|
21
21
|
"""
|
22
22
|
'test'
|
23
23
|
"""
|
24
|
-
And the file "my-app/src/
|
24
|
+
And the file "my-app/src/components/test/test.module.coffee" should contain:
|
25
25
|
"""
|
26
26
|
angular.module 'test', [
|
27
27
|
]
|
28
28
|
"""
|
29
|
-
|
30
|
-
Scenario: Generating a route in the components directory
|
31
|
-
When I set up Rugular and run "rugular generate directive -c test"
|
32
|
-
And the file "my-app/src/components/test/test.directive.coffee" should contain:
|
33
|
-
"""
|
34
|
-
angular.module('test').directive('test', test)
|
35
|
-
"""
|
@@ -33,13 +33,6 @@ Feature: Rugular CLI
|
|
33
33
|
"""
|
34
34
|
And a file named "my-app/src/app/test/_test.sass" should exist
|
35
35
|
|
36
|
-
Scenario: Generating a route in the components directory
|
37
|
-
When I set up Rugular and run "rugular generate route -c test"
|
38
|
-
Then the file "my-app/src/components/test/test.controller.coffee" should contain:
|
39
|
-
"""
|
40
|
-
angular.module('test').controller('testController', testController)
|
41
|
-
"""
|
42
|
-
|
43
36
|
Scenario: Generating a multiple word route
|
44
37
|
When I set up Rugular and run "rugular generate route credit_card"
|
45
38
|
Then the file "my-app/src/app/credit_card/credit_card.controller.coffee" should contain:
|
@@ -0,0 +1,101 @@
|
|
1
|
+
module Rugular
|
2
|
+
class Abstract < Thor::Group
|
3
|
+
include Thor::Actions
|
4
|
+
|
5
|
+
argument :folder, desc: 'Component folder you want to abstract'
|
6
|
+
desc <<-DESC
|
7
|
+
The abstract command copies the contents of any folder nested one-level
|
8
|
+
beneath ``src/components`` into the ``~/bower_components`` folder where
|
9
|
+
it is treated like a bower component.
|
10
|
+
|
11
|
+
The command will ask some setup questions to generate a bower.json. It is
|
12
|
+
recommended that the bower component folders generated by rugular are NOT
|
13
|
+
edited by hand. Instead, the only updates should occur by repeated use of
|
14
|
+
the ``rugular abstract`` command.
|
15
|
+
DESC
|
16
|
+
|
17
|
+
def check_for_rugular_directory
|
18
|
+
::Rugular::AppChecker.check_for_rugular_directory(
|
19
|
+
task_name: self.class.name,
|
20
|
+
root_directory: destination_root
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def ask_for_version
|
25
|
+
@version = ask(
|
26
|
+
"the previous version is #{previous_version}, what is the version now?"
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
def file_copy_folder_into_bower_src_folder
|
31
|
+
directory component_directory, bower_component_directory
|
32
|
+
end
|
33
|
+
|
34
|
+
def create_bower_file
|
35
|
+
return if bower_component_bower_json?
|
36
|
+
|
37
|
+
create_file "#{bower_component_directory}/bower.json" do
|
38
|
+
ERB.new(bower_template_file).result(
|
39
|
+
bower_open_struct.instance_eval { binding }
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def bower_component_bower_json?
|
47
|
+
File.exists? bower_component_directory
|
48
|
+
end
|
49
|
+
|
50
|
+
def bower_component_bower_json
|
51
|
+
JSON.parse(File.read("#{bower_component_directory}/bower.json"))
|
52
|
+
end
|
53
|
+
|
54
|
+
def previous_version
|
55
|
+
return 'not defined' unless bower_component_bower_json?
|
56
|
+
|
57
|
+
bower_component_bower_json.fetch('version', '0.0.0')
|
58
|
+
end
|
59
|
+
|
60
|
+
def bower_json
|
61
|
+
JSON.parse(File.read('bower.json'))
|
62
|
+
end
|
63
|
+
|
64
|
+
def git_username
|
65
|
+
"#{`git config user.name`.strip} <#{`git config user.email`.strip}>"
|
66
|
+
end
|
67
|
+
|
68
|
+
def bower_component_directory
|
69
|
+
"#{Dir.home}/bower_components/#{folder}"
|
70
|
+
end
|
71
|
+
|
72
|
+
def component_directory
|
73
|
+
"./src/components/#{folder}/"
|
74
|
+
end
|
75
|
+
|
76
|
+
def main_javascript_files
|
77
|
+
Dir.glob("#{component_directory}/*").map do |filename|
|
78
|
+
File.basename(filename)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def bower_open_struct
|
83
|
+
OpenStruct.new(
|
84
|
+
name: folder,
|
85
|
+
version: @version,
|
86
|
+
git_username: git_username,
|
87
|
+
description: folder,
|
88
|
+
main_javascript_files: main_javascript_files,
|
89
|
+
dev_dependencies: bower_json.fetch('devDependencies', {}),
|
90
|
+
dependencies: bower_json.fetch('dependencies', {}),
|
91
|
+
resolutions: bower_json.fetch('resolutions', {})
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
95
|
+
def bower_template_file
|
96
|
+
lib_directory = __dir__.chomp('/tasks')
|
97
|
+
|
98
|
+
File.read("#{lib_directory}/templates/abstract/bower.json")
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
data/lib/rugular/tasks/build.rb
CHANGED
@@ -40,8 +40,8 @@ module Rugular
|
|
40
40
|
File.open('dist/application.js', 'w') do |file|
|
41
41
|
file.write(
|
42
42
|
Uglifier.compile(
|
43
|
-
Rugular::JavascriptFiles.map do |
|
44
|
-
text = File.read(
|
43
|
+
Rugular::JavascriptFiles.map do |javascript_file|
|
44
|
+
text = File.read(javascript_file).gsub('templateUrl', 'template')
|
45
45
|
CoffeeScript.compile(text)
|
46
46
|
end.join
|
47
47
|
)
|
@@ -15,17 +15,26 @@ module Rugular
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def bundle
|
18
|
-
puts
|
18
|
+
puts <<-GEM_MESSAGE
|
19
|
+
~~~~~~~~*\o/~~~~~/\*~~~~~~~
|
20
|
+
Installing Ruby gems
|
21
|
+
GEM_MESSAGE
|
19
22
|
system('bundle install')
|
20
23
|
end
|
21
24
|
|
22
25
|
def bower
|
23
|
-
puts
|
26
|
+
puts <<-BOWER_MESSAGE
|
27
|
+
~~~~~~~~*\o/~~~~~/\*~~~~~~~
|
28
|
+
Installing bower components
|
29
|
+
BOWER_MESSAGE
|
24
30
|
system('bower install')
|
25
31
|
end
|
26
32
|
|
27
33
|
def npm_install
|
28
|
-
puts
|
34
|
+
puts <<-NODE_MESSAGE
|
35
|
+
~~~~~~~~*\o/~~~~~/\*~~~~~~~
|
36
|
+
Installing node packages
|
37
|
+
NODE_MESSAGE
|
29
38
|
system('npm install')
|
30
39
|
end
|
31
40
|
|
@@ -7,12 +7,6 @@ module Rugular
|
|
7
7
|
|
8
8
|
argument :name, desc: 'Name for your route'
|
9
9
|
|
10
|
-
class_option(
|
11
|
-
:c,
|
12
|
-
type: :boolean,
|
13
|
-
desc: 'create the route in the component folder'
|
14
|
-
)
|
15
|
-
|
16
10
|
def self.source_root
|
17
11
|
__dir__.chomp('/tasks/generate')
|
18
12
|
end
|
@@ -48,6 +42,7 @@ module Rugular
|
|
48
42
|
end
|
49
43
|
|
50
44
|
def template_files; []; end
|
45
|
+
def app_or_component; 'components' end
|
51
46
|
|
52
47
|
protected
|
53
48
|
|
@@ -62,7 +57,7 @@ module Rugular
|
|
62
57
|
end
|
63
58
|
|
64
59
|
def folder
|
65
|
-
|
60
|
+
"src/#{app_or_component}/#{name_folder}"
|
66
61
|
end
|
67
62
|
|
68
63
|
def destination_file(pathname)
|
@@ -105,9 +100,5 @@ module Rugular
|
|
105
100
|
"src/#{app_or_component}/#{name.split(':')[0..-2].join('/')}/"\
|
106
101
|
"#{nested_module_name}.module.coffee"
|
107
102
|
end
|
108
|
-
|
109
|
-
def app_or_component
|
110
|
-
options[:c] ? 'components' : 'app'
|
111
|
-
end
|
112
103
|
end
|
113
104
|
end
|
@@ -1,18 +1,17 @@
|
|
1
1
|
module Rugular
|
2
2
|
class JavascriptFiles
|
3
3
|
def self.ordered_array
|
4
|
-
Dir.glob(
|
5
|
-
Dir.glob(
|
6
|
-
Dir.glob(
|
7
|
-
Dir.glob(
|
8
|
-
Dir.glob(
|
9
|
-
Dir.glob(
|
10
|
-
Dir.glob(
|
11
|
-
Dir.glob(
|
12
|
-
Dir.glob(
|
13
|
-
Dir.glob(
|
14
|
-
Dir.glob(
|
15
|
-
Dir.glob("src/app/**/*.routes.coffee")
|
4
|
+
Dir.glob('src/components/**/*.module.coffee') +
|
5
|
+
Dir.glob('src/components/**/*.constant.coffee') +
|
6
|
+
Dir.glob('src/components/**/*.factory.coffee') +
|
7
|
+
Dir.glob('src/components/**/*.filter.coffee') +
|
8
|
+
Dir.glob('src/components/**/*.controller.coffee') +
|
9
|
+
Dir.glob('src/components/**/*.directive.coffee') +
|
10
|
+
Dir.glob('src/app/**/*.module.coffee') +
|
11
|
+
Dir.glob('src/app/**/*.config.coffee')
|
12
|
+
Dir.glob('src/app/**/*.constant.coffee') +
|
13
|
+
Dir.glob('src/app/**/*.controller.coffee') +
|
14
|
+
Dir.glob('src/app/**/*.routes.coffee')
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
data/lib/rugular/tasks/new.rb
CHANGED
@@ -42,8 +42,14 @@ module Rugular
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def installation_complete
|
45
|
-
puts
|
46
|
-
|
45
|
+
puts <<-POST_INSTALL_MESSAGE
|
46
|
+
♪┏(°.°)┛┗(°.°)┓┗(°.°)┛┏(°.°)┓┏(°.°)┛┗(°.°)┓┗(°.°)┛┏(°.°)┓♪
|
47
|
+
|
48
|
+
Thank you for installing Rugular, please finish setting up your
|
49
|
+
project with: `cd #{app_open_struct.name} && rugular dependencies`
|
50
|
+
|
51
|
+
♪┏(°.°)┛┗(°.°)┓┗(°.°)┛┏(°.°)┓┏(°.°)┛┗(°.°)┓┗(°.°)┛┏(°.°)┓♪
|
52
|
+
POST_INSTALL_MESSAGE
|
47
53
|
end
|
48
54
|
|
49
55
|
private
|
data/lib/rugular/tasks/server.rb
CHANGED
@@ -18,13 +18,6 @@ module Rugular
|
|
18
18
|
"(set in lib/rugular/tasks/server/Procfile)"
|
19
19
|
)
|
20
20
|
|
21
|
-
def add_template_application_sass_file
|
22
|
-
FileUtils.cp(
|
23
|
-
"#{lib_directory}/templates/server/application.sass",
|
24
|
-
"#{destination_root}/.application.sass"
|
25
|
-
)
|
26
|
-
end
|
27
|
-
|
28
21
|
def start_server
|
29
22
|
system(
|
30
23
|
"bundle exec foreman start --color --root=#{destination_root} " \
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"name": "<%= name %>",
|
3
|
+
"version": "<%= version %>",
|
4
|
+
"authors": [
|
5
|
+
"<%= git_username %>"
|
6
|
+
],
|
7
|
+
"description": "<%= description %>",
|
8
|
+
"main": "<%= main_javascript_files %>",
|
9
|
+
"moduleType": [
|
10
|
+
"es6"
|
11
|
+
],
|
12
|
+
"keywords": [
|
13
|
+
"yes"
|
14
|
+
],
|
15
|
+
"license": "Copyright by the authors of the commits on the master branch of this application.",
|
16
|
+
"private": true,
|
17
|
+
"ignore": [
|
18
|
+
"**/.*",
|
19
|
+
"node_modules",
|
20
|
+
"bower_components",
|
21
|
+
"test",
|
22
|
+
"tests"
|
23
|
+
],
|
24
|
+
"devDependencies": <%= dev_dependencies %>,
|
25
|
+
"dependencies": <%= dependencies %>,
|
26
|
+
"resolutions": <%= resolutions %>
|
27
|
+
}
|
data/lib/rugular/version.rb
CHANGED
data/lib/rugular.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rugular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Shook
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -292,14 +292,18 @@ files:
|
|
292
292
|
- README.md
|
293
293
|
- Rakefile
|
294
294
|
- bin/rugular
|
295
|
+
- bower.json
|
295
296
|
- circle.yml
|
297
|
+
- features/abstract.feature
|
296
298
|
- features/continuous_integration.feature
|
297
299
|
- features/generator_for_directive.feature
|
298
300
|
- features/generator_for_route.feature
|
299
301
|
- features/new.feature
|
300
302
|
- features/step_definitions/rugular_steps.rb
|
303
|
+
- features/support/env.rb
|
301
304
|
- features/support/setup.rb
|
302
305
|
- lib/rugular.rb
|
306
|
+
- lib/rugular/tasks/abstract.rb
|
303
307
|
- lib/rugular/tasks/build.rb
|
304
308
|
- lib/rugular/tasks/continuous_integration.rb
|
305
309
|
- lib/rugular/tasks/dependencies.rb
|
@@ -325,6 +329,7 @@ files:
|
|
325
329
|
- lib/rugular/tasks/server/guards/rugular_index_html.rb
|
326
330
|
- lib/rugular/tasks/tmux.rb
|
327
331
|
- lib/rugular/tasks/tmux/tmuxinator.yml
|
332
|
+
- lib/rugular/templates/abstract/bower.json.erb
|
328
333
|
- lib/rugular/templates/directive/_app.sass.erb
|
329
334
|
- lib/rugular/templates/directive/app.controller.coffee.erb
|
330
335
|
- lib/rugular/templates/directive/app.directive.coffee.erb
|
@@ -390,9 +395,11 @@ signing_key:
|
|
390
395
|
specification_version: 4
|
391
396
|
summary: Rugular - a ruby scaffolding framework for AngularJS
|
392
397
|
test_files:
|
398
|
+
- features/abstract.feature
|
393
399
|
- features/continuous_integration.feature
|
394
400
|
- features/generator_for_directive.feature
|
395
401
|
- features/generator_for_route.feature
|
396
402
|
- features/new.feature
|
397
403
|
- features/step_definitions/rugular_steps.rb
|
404
|
+
- features/support/env.rb
|
398
405
|
- features/support/setup.rb
|