carrasco 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.carrasco.yml +4 -0
- data/.scrutinizer.yml +16 -0
- data/.travis.yml +9 -2
- data/README.md +11 -2
- data/Rakefile +18 -1
- data/carrasco.gemspec +5 -0
- data/lib/carrasco/command.rb +15 -0
- data/lib/carrasco/command_builder.rb +11 -10
- data/lib/carrasco/version.rb +1 -1
- data/lib/carrasco.rb +1 -0
- metadata +76 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dd8ab3b0403998b8a687d65456c0fb2b71db3c1
|
4
|
+
data.tar.gz: c673f154eddb65b81aa1e34c96be10ecc582b248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57adb5427db68ea32207a985fef0b913d034c7362be70b0614a4ee052e16cf47a500323c3c15548d5f5729f51e3b76413d1c14781b592e476bcb86e263dc3ae7
|
7
|
+
data.tar.gz: 3b2941ce20dd9894ff0857da9e75d85acbebffa246b6507c896a9eb90c569607e011ff65a24673fc3f4143550f4e072cbecdd79e5936d812fe95ca62a8f3a36c
|
data/.carrasco.yml
CHANGED
data/.scrutinizer.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
checks:
|
2
|
+
ruby:
|
3
|
+
code_rating: true
|
4
|
+
duplicate_code: true
|
5
|
+
|
6
|
+
build:
|
7
|
+
tests:
|
8
|
+
override:
|
9
|
+
-
|
10
|
+
command: 'bundle exec rake test:scrutinizer'
|
11
|
+
environment:
|
12
|
+
'SCRUTINIZER_CC_FILE': 'my-coverage'
|
13
|
+
ruby: '2.2.0'
|
14
|
+
coverage:
|
15
|
+
file: 'my-coverage'
|
16
|
+
format: 'rb-cc'
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
Heartless and easy script execution
|
4
4
|
|
5
|
+
[![Build Status](https://travis-ci.org/mjacobus/carrasco.svg)](https://travis-ci.org/mjacobus/carrasco)
|
6
|
+
[![Code Coverage](https://scrutinizer-ci.com/g/mjacobus/carrasco/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/mjacobus/carrasco/?branch=master)
|
7
|
+
[![Code Climate](https://codeclimate.com/github/mjacobus/carrasco/badges/gpa.svg)](https://codeclimate.com/github/mjacobus/carrasco)
|
8
|
+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mjacobus/carrasco/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mjacobus/carrasco/?branch=master)
|
9
|
+
[![Dependency Status](https://gemnasium.com/mjacobus/carrasco.svg)](https://gemnasium.com/mjacobus/carrasco)
|
10
|
+
[![Gem Version](https://badge.fury.io/rb/carrasco.svg)](https://badge.fury.io/rb/carrasco)
|
11
|
+
|
5
12
|
## Installation
|
6
13
|
|
7
14
|
Add this line to your application's Gemfile:
|
@@ -28,15 +35,17 @@ Given you have a config file like the following in the root of your project:
|
|
28
35
|
commands:
|
29
36
|
|
30
37
|
test:
|
31
|
-
help: test
|
32
38
|
description: execute ruby tests
|
33
39
|
command: rake test
|
34
40
|
|
35
41
|
phpunit:
|
36
|
-
help: phpunit
|
37
42
|
description: execute php tests
|
38
43
|
command: ./bin/vendor/phpunit --configuration=tests/phpunit.xml
|
39
44
|
|
45
|
+
clear_cache:
|
46
|
+
description: Clears the application cache
|
47
|
+
command: rm -rf ./app/cache
|
48
|
+
|
40
49
|
# to be implemented
|
41
50
|
groups:
|
42
51
|
qa:
|
data/Rakefile
CHANGED
@@ -7,4 +7,21 @@ Rake::TestTask.new(:test) do |t|
|
|
7
7
|
t.test_files = FileList['test/**/*_test.rb']
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
namespace :test do
|
11
|
+
task :coveralls do
|
12
|
+
ENV["COVERALLS"] = "true"
|
13
|
+
Rake::Task["test:coverage"].invoke
|
14
|
+
end
|
15
|
+
|
16
|
+
task :coverage do
|
17
|
+
ENV["COVERAGE"] = "true"
|
18
|
+
Rake::Task["test"].invoke
|
19
|
+
end
|
20
|
+
|
21
|
+
task :scrutinizer do
|
22
|
+
ENV["SCRUTINIZER"] = "true"
|
23
|
+
Rake::Task["test"].invoke
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
task default: :test
|
data/carrasco.gemspec
CHANGED
@@ -32,4 +32,9 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 1.10"
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
34
|
spec.add_development_dependency "minitest"
|
35
|
+
spec.add_development_dependency "capybara"
|
36
|
+
spec.add_development_dependency "coveralls"
|
37
|
+
spec.add_development_dependency "simplecov"
|
38
|
+
spec.add_development_dependency "scrutinizer-ocular"
|
39
|
+
spec.add_development_dependency "mocha"
|
35
40
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "thor/core_ext/hash_with_indifferent_access"
|
2
|
+
|
3
|
+
module Carrasco
|
4
|
+
class Command
|
5
|
+
attr_reader :command_name, :command, :description, :help
|
6
|
+
|
7
|
+
def initialize(command_name, options = {})
|
8
|
+
options = Thor::CoreExt::HashWithIndifferentAccess.new(options)
|
9
|
+
@command_name = command_name
|
10
|
+
@command = options[:command]
|
11
|
+
@help = options[:help] || command_name
|
12
|
+
@description = options[:description] || "description not given"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -6,19 +6,20 @@ module Carrasco
|
|
6
6
|
klass = Class.new(Thor)
|
7
7
|
|
8
8
|
config['commands'].each do |method, options|
|
9
|
-
|
10
|
-
|
11
|
-
command = options.fetch('command')
|
12
|
-
|
13
|
-
klass.class_eval do
|
14
|
-
desc help, description
|
15
|
-
define_method (method) do
|
16
|
-
system(command)
|
17
|
-
end
|
18
|
-
end
|
9
|
+
command = Command.new(method, options)
|
10
|
+
inject_command_into_class(command, klass)
|
19
11
|
end
|
20
12
|
|
21
13
|
klass
|
22
14
|
end
|
15
|
+
|
16
|
+
def inject_command_into_class(command, klass)
|
17
|
+
klass.desc(command.help, command.description)
|
18
|
+
klass.class_eval do
|
19
|
+
define_method(command.command_name) do
|
20
|
+
system(command.command)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
23
24
|
end
|
24
25
|
end
|
data/lib/carrasco/version.rb
CHANGED
data/lib/carrasco.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrasco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Jacobus
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,6 +66,76 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: capybara
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: scrutinizer-ocular
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: mocha
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
69
139
|
description: Command executor
|
70
140
|
email:
|
71
141
|
- marcelo.jacobus@gmail.com
|
@@ -76,6 +146,7 @@ extra_rdoc_files: []
|
|
76
146
|
files:
|
77
147
|
- ".carrasco.yml"
|
78
148
|
- ".gitignore"
|
149
|
+
- ".scrutinizer.yml"
|
79
150
|
- ".travis.yml"
|
80
151
|
- CODE_OF_CONDUCT.md
|
81
152
|
- Gemfile
|
@@ -87,6 +158,7 @@ files:
|
|
87
158
|
- carrasco.gemspec
|
88
159
|
- exe/carrasco
|
89
160
|
- lib/carrasco.rb
|
161
|
+
- lib/carrasco/command.rb
|
90
162
|
- lib/carrasco/command_builder.rb
|
91
163
|
- lib/carrasco/version.rb
|
92
164
|
homepage: https://github.com/mjacobus/carrasco
|
@@ -110,8 +182,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
182
|
version: '0'
|
111
183
|
requirements: []
|
112
184
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.4.
|
185
|
+
rubygems_version: 2.4.6
|
114
186
|
signing_key:
|
115
187
|
specification_version: 4
|
116
188
|
summary: Command executor
|
117
189
|
test_files: []
|
190
|
+
has_rdoc:
|