console_runner 0.1.1 → 0.1.2
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 +4 -4
- data/README.md +1 -1
- data/exe/c_run +7 -86
- data/exe/c_run.rb +0 -7
- data/lib/console_runner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 536a22f5c750f346fc7688315a6c309a36a3af1c
|
4
|
+
data.tar.gz: b5466496a8650cd2b9c5ec8d4b73bb46e18a870f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5df1a7e4eda87dafbb436f4e1aadc6ef562d58529b8eedeed9713ac8a6f9ce29a8cab33f51562b9a09b984b0564ff4d32a1a6b4797bf57dff7255aafc493c8e
|
7
|
+
data.tar.gz: 5ed013791df3f7a7dd0b0efbe1cd6614b956899fb0508c572bef1bcde52c830b6e46e0b23716ef6e302d5fbc4714010e28993f99e8d4346f0a56b2d020387b10
|
data/README.md
CHANGED
@@ -51,7 +51,7 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
51
51
|
[Code Climate]: https://codeclimate.com/github/yuri-karpovich/console_runner
|
52
52
|
[Coverage Status]: https://coveralls.io/github/yuri-karpovich/console_runner
|
53
53
|
|
54
|
-
[GV img]: https://badge.fury.io/rb/console_runner.
|
54
|
+
[GV img]: https://badge.fury.io/rb/console_runner.svg
|
55
55
|
[BS img]: https://travis-ci.org/yuri-karpovich/console_runner.svg?branch=master
|
56
56
|
[DS img]: https://gemnasium.com/badges/github.com/yuri-karpovich/console_runner.svg
|
57
57
|
[CC img]: https://codeclimate.com/github/yuri-karpovich/console_runner.png
|
data/exe/c_run
CHANGED
@@ -1,86 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
# require '../lib/cmd_parser'
|
9
|
-
# require '../lib/runner'
|
10
|
-
#
|
11
|
-
# file_path = ENV['DEBUG_FILE']
|
12
|
-
# file_path ||= File.realpath ARGV.shift
|
13
|
-
# file_parser = FileParser.new(file_path)
|
14
|
-
#
|
15
|
-
#
|
16
|
-
# runnable_classes = file_parser.list_classes(:runnable)
|
17
|
-
# raise "One runnable Class should be specified in file.
|
18
|
-
# Runnable class should be marked with @#{FileParser::RUNNABLE_TAG.to_s} tag" if runnable_classes.count != 1
|
19
|
-
#
|
20
|
-
# clazz = runnable_classes.first
|
21
|
-
# all_methods = file_parser.list_methods(:all, clazz)
|
22
|
-
# runnable_methods = file_parser.list_methods(:runnable, clazz)
|
23
|
-
# initialize_method = all_methods.find{|m| m.name == :initialize}
|
24
|
-
# run_method = all_methods.find{|m| m.name == :run}
|
25
|
-
#
|
26
|
-
#
|
27
|
-
# cmd_parser = CmdParser.new(runnable_methods, initialize_method)
|
28
|
-
# cmd = ARGV[0]
|
29
|
-
# action_method = runnable_methods.find { |m| m.name.to_s == cmd } # get the subcommand
|
30
|
-
# action_method ||= run_method
|
31
|
-
# cmd_parser.parse_method action_method
|
32
|
-
# raise "Cannot run #{cmd} command because method is nil" unless action_method
|
33
|
-
#
|
34
|
-
#
|
35
|
-
# puts "======================================================="
|
36
|
-
# puts "Global options:"
|
37
|
-
# puts cmd_parser.global_opts.map{|k,v| " #{k} = #{v}" }.join("\n")
|
38
|
-
# if initialize_method
|
39
|
-
# puts "INIT: #{initialize_method.name}"
|
40
|
-
# puts "INIT options:"
|
41
|
-
# puts cmd_parser.init_method.cmd_opts.map{|k,v| " #{k} = #{v}" }.join("\n")
|
42
|
-
# end
|
43
|
-
# puts "Subcommand: #{action_method.name}"
|
44
|
-
# puts "Subcommand options:"
|
45
|
-
# puts cmd_parser.method.cmd_opts.map{|k,v| " #{k} = #{v}" }.join("\n")
|
46
|
-
# puts "Remaining arguments: #{ARGV.inspect}" if ARGV != []
|
47
|
-
# puts "======================================================="
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# Runner.run{
|
51
|
-
# require file_path
|
52
|
-
# class_full_name = clazz.title
|
53
|
-
# raise "#{class_full_name} is not defined" unless Module.const_defined?(class_full_name)
|
54
|
-
# klass_obj = Module.const_get(class_full_name)
|
55
|
-
# method_type = action_method.scope
|
56
|
-
# method_params = cmd_parser.method.params_array
|
57
|
-
#
|
58
|
-
# case method_type
|
59
|
-
# when :class
|
60
|
-
# klass_obj.send(action_method.name, *method_params)
|
61
|
-
# when :instance
|
62
|
-
# init_params = cmd_parser.init_method.params_array
|
63
|
-
# # TODO catch errors
|
64
|
-
# obj = klass_obj.new(*init_params)
|
65
|
-
# obj.send(action_method.name, *method_params)
|
66
|
-
# else
|
67
|
-
# raise "Unknown method type: #{method_type}"
|
68
|
-
# end
|
69
|
-
#
|
70
|
-
# }
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
# # raise "#{clazz.name}#initialize method should be specified" unless initialize_method
|
82
|
-
# #
|
83
|
-
# # raise "At least one method should be marked with @#{FileParser::RUNNABLE_TAG.to_s} tag.
|
84
|
-
# # Also you may specify #run method and it will be executed by default.
|
85
|
-
# # #run method don't need any code annotations as well." if runnable_methods.count == 0 unless run_method
|
86
|
-
#
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require_relative '../test/simple_cov' if ENV['C_RUNNER_SCOV'].to_s == 'true'
|
4
|
+
|
5
|
+
lib = File.expand_path('../../lib', __FILE__)
|
6
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
7
|
+
require 'console_runner'
|
data/exe/c_run.rb
CHANGED