saddler 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 +4 -4
- data/.rubocop.yml +17 -0
- data/.travis.yml +13 -1
- data/README.md +3 -4
- data/Rakefile +5 -5
- data/bin/console +3 -3
- data/exe/saddler +3 -1
- data/lib/saddler.rb +2 -1
- data/lib/saddler/cli.rb +47 -0
- data/lib/saddler/reporter.rb +19 -0
- data/lib/saddler/version.rb +1 -1
- data/saddler.gemspec +15 -12
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f001bda35125b041d894da07196b1fbfaa9e8e
|
4
|
+
data.tar.gz: 717514af9b6c3bfbf43a2ac60d7dd66e3d22dc4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02e77eaaa3b3588b4155a02b5a0c43864626d3c6f5f93ac8cc216e11966ef06d8f79d316de85d988d14dfa48ae516a82934c154ccb63e2965ae4922582bc3987
|
7
|
+
data.tar.gz: 9c53e08d4b77d59e179cf40a9e4c9e0fcb32df9c725366750995f539f86bc8ac0eacfe7950413ee13c6b9a5b471ed881abe98364eedeb313602b2d87d1d6c273
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# Saddler
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/saddler.svg?style=flat)](http://badge.fury.io/rb/saddler)
|
4
|
+
[![Build Status](http://img.shields.io/travis/packsaddle/ruby-saddler/master.svg?style=flat)](https://travis-ci.org/packsaddle/ruby-saddler)
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
@@ -32,7 +31,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
31
|
|
33
32
|
## Contributing
|
34
33
|
|
35
|
-
1. Fork it ( https://github.com/
|
34
|
+
1. Fork it ( https://github.com/packsaddle/ruby-saddler/fork )
|
36
35
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
36
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
37
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
3
|
|
4
4
|
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs <<
|
5
|
+
t.libs << 'test'
|
6
|
+
t.test_files = FileList['test/**/test*.rb']
|
6
7
|
end
|
7
8
|
|
8
|
-
task :
|
9
|
-
|
9
|
+
task default: :test
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'saddler'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "saddler"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
data/exe/saddler
CHANGED
data/lib/saddler.rb
CHANGED
data/lib/saddler/cli.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module Saddler
|
4
|
+
class CLI < Thor
|
5
|
+
def self.exit_on_failure?
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'version', 'Show the Saddler version'
|
10
|
+
map %w(-v --version) => :version
|
11
|
+
|
12
|
+
def version
|
13
|
+
puts "Saddler version #{::Saddler::VERSION}"
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'report', 'Exec Report'
|
17
|
+
option :data
|
18
|
+
option :file
|
19
|
+
option :repo
|
20
|
+
option :require
|
21
|
+
option :reporter
|
22
|
+
def report
|
23
|
+
data = \
|
24
|
+
if options[:data]
|
25
|
+
options[:data]
|
26
|
+
elsif options[:file]
|
27
|
+
File.read(options[:file])
|
28
|
+
elsif !$stdin.tty?
|
29
|
+
ARGV.clear
|
30
|
+
ARGF.read
|
31
|
+
end
|
32
|
+
|
33
|
+
abort('no input') if !data || data.empty?
|
34
|
+
|
35
|
+
pass_options = {}
|
36
|
+
pass_options[:repo] = options[:repo] if options[:repo]
|
37
|
+
|
38
|
+
require options[:require] if options[:require]
|
39
|
+
if(options[:reporter])
|
40
|
+
reporter = ::Saddler::Reporter.add_reporter(options[:reporter], $stdout)
|
41
|
+
end
|
42
|
+
|
43
|
+
abort('no reporter') unless reporter
|
44
|
+
reporter.report(data, pass_options)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Saddler
|
2
|
+
module Reporter
|
3
|
+
def self.add_reporter(reporter_type, output = nil)
|
4
|
+
reporter = custom_reporter_class(reporter_type)
|
5
|
+
output = $stdout unless output
|
6
|
+
reporter.new(output)
|
7
|
+
end
|
8
|
+
|
9
|
+
# Copy from rubocop:
|
10
|
+
# lib/rubocop/formatter/formatter_set.rb
|
11
|
+
def self.custom_reporter_class(specified_class_name)
|
12
|
+
constant_names = specified_class_name.split('::')
|
13
|
+
constant_names.shift if constant_names.first.empty?
|
14
|
+
constant_names.reduce(Object) do |namespace, constant_name|
|
15
|
+
namespace.const_get(constant_name, false)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/saddler/version.rb
CHANGED
data/saddler.gemspec
CHANGED
@@ -4,22 +4,25 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'saddler/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'saddler'
|
8
8
|
spec.version = Saddler::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['sanemat']
|
10
|
+
spec.email = ['o.gata.ken@gmail.com']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
12
|
+
spec.summary = 'Saddler.'
|
13
|
+
spec.description = 'Saddler.'
|
14
|
+
spec.homepage = 'https://github.com/packsaddle/ruby-saddler'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir =
|
18
|
+
spec.bindir = 'exe'
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.
|
23
|
-
spec.
|
24
|
-
|
22
|
+
spec.add_runtime_dependency 'thor'
|
23
|
+
spec.add_runtime_dependency 'saddler-reporter-text'
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.8'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'minitest'
|
25
28
|
end
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saddler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: saddler-reporter-text
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: bundler
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,6 +89,7 @@ extensions: []
|
|
61
89
|
extra_rdoc_files: []
|
62
90
|
files:
|
63
91
|
- ".gitignore"
|
92
|
+
- ".rubocop.yml"
|
64
93
|
- ".travis.yml"
|
65
94
|
- CODE_OF_CONDUCT.md
|
66
95
|
- Gemfile
|
@@ -71,6 +100,8 @@ files:
|
|
71
100
|
- bin/setup
|
72
101
|
- exe/saddler
|
73
102
|
- lib/saddler.rb
|
103
|
+
- lib/saddler/cli.rb
|
104
|
+
- lib/saddler/reporter.rb
|
74
105
|
- lib/saddler/version.rb
|
75
106
|
- saddler.gemspec
|
76
107
|
homepage: https://github.com/packsaddle/ruby-saddler
|