fox 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/fox +13 -20
- data/fox.gemspec +1 -0
- data/lib/fox.rb +32 -27
- data/lib/fox/cli.rb +34 -4
- data/lib/fox/interface/thor/{info.thor → info.rb} +0 -0
- data/lib/fox/interface/thor/{new.thor → new.rb} +0 -0
- data/lib/fox/interface/thor/{pomodoro.thor → pomodoro.rb} +0 -0
- data/lib/fox/runner.rb +63 -0
- data/lib/fox/version.rb +1 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be5201a58f9e94288879c098b0533b809cb74c99
|
4
|
+
data.tar.gz: eca1fcc17a0d10eb7a6b6bc7171974fd9dcd58fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4420c104c34d227a3a4c4b034733651e3450fc79971b15fcd80559fc6b9b64e2a545894a05437b58eace85219d9d9c67456e3943f95e6496c9b024b396bfd11a
|
7
|
+
data.tar.gz: 4ba92ae15573ea3b32f5fec01a0de4b191520f1ffcfe056886cff8dae9245b5d780f14fdd4652886ac730f6426b15c54d8c490ebf7d34bccb7e39feb812c1def
|
data/bin/fox
CHANGED
@@ -4,9 +4,6 @@
|
|
4
4
|
$LOAD_PATH << '.'
|
5
5
|
$LOAD_PATH << 'lib'
|
6
6
|
|
7
|
-
$LOAD_PATH << File.expand_path("#{File.expand_path('../..', __FILE__)}/lib/fox/messages")
|
8
|
-
$LOAD_PATH << File.expand_path("#{File.expand_path('../..', __FILE__)}/lib/fox/service")
|
9
|
-
|
10
7
|
# System includes
|
11
8
|
require 'bundler'
|
12
9
|
|
@@ -16,27 +13,23 @@ require 'thor/runner'
|
|
16
13
|
|
17
14
|
# Development Mode?
|
18
15
|
if ENV["FOX_ENV"] == "development"
|
19
|
-
|
16
|
+
require "simplecov"
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
# Ensure merging of subprocesses by giving them a special name
|
19
|
+
# SimpleCov.command_name ARGV.join(" ")
|
20
|
+
SimpleCov.command_name "Fox #{Process.pid}"
|
24
21
|
|
25
|
-
|
26
|
-
|
22
|
+
# Set the correct root folder for SimpleCov
|
23
|
+
SimpleCov.root File.join(File.expand_path(File.dirname(__FILE__)), "..")
|
27
24
|
|
28
|
-
|
29
|
-
|
25
|
+
# Start coverage
|
26
|
+
SimpleCov.start
|
30
27
|
end # of if ENV
|
31
28
|
|
32
|
-
|
33
|
-
#
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
$thor_runner = true
|
39
|
-
CLI.start
|
40
|
-
|
29
|
+
require 'fox'
|
30
|
+
# require File.expand_path("#{File.expand_path('../..', __FILE__)}/lib/fox/cli")
|
31
|
+
# CLI.start
|
32
|
+
# $thor_runner = true
|
33
|
+
Fox::Runner.new(ARGV.dup).execute!
|
41
34
|
|
42
35
|
# vim:ts=2:tw=100:wm=100:syntax=ruby
|
data/fox.gemspec
CHANGED
data/lib/fox.rb
CHANGED
@@ -7,32 +7,37 @@ require 'rake'
|
|
7
7
|
require 'ruby-try'
|
8
8
|
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
10
|
+
require_relative "fox/runner"
|
11
|
+
require_relative "fox/version"
|
12
|
+
|
13
|
+
# Load all Thor/Rake file tasks
|
14
|
+
#Dir.glob( "fox/interface/thor/**/*.{thor,rb}" ) { |name| Thor::Util.load_thorfile name }
|
15
|
+
#Dir.glob( "fox/interface/rake/**/*.{rake,rb}" ) { |name| load name }
|
16
|
+
|
17
|
+
|
18
|
+
# # @module module Fox
|
19
|
+
# # @brief Fox modules and classes namespace
|
20
|
+
# module Fox
|
21
|
+
#
|
22
|
+
# require_relative 'fox/version'
|
23
|
+
# # require_relative 'fox/error'
|
24
|
+
#
|
25
|
+
# # # @module module Mixin
|
26
|
+
# # # @brief Mixin module contains various functions to be used in other components
|
27
|
+
# # module Mixin
|
28
|
+
#
|
29
|
+
# # # autoload :Guess, 'fox/mixin/'
|
30
|
+
#
|
31
|
+
# # end # of module Mixing
|
32
|
+
#
|
33
|
+
# # autoload :Cache, 'fox/library/cache'
|
34
|
+
# # autoload :Choice, 'fox/library/choice'
|
35
|
+
#
|
36
|
+
# # class << self
|
37
|
+
# # end # of class << self
|
38
|
+
#
|
39
|
+
# end # of module Fox
|
40
|
+
#
|
41
|
+
# # Default.start
|
37
42
|
|
38
43
|
# vim:ts=2:tw=100:wm=100:syntax=ruby
|
data/lib/fox/cli.rb
CHANGED
@@ -6,12 +6,42 @@ require "thor"
|
|
6
6
|
# Custom
|
7
7
|
require File.expand_path(File.dirname(__FILE__) + '/interface/thor/version')
|
8
8
|
require File.expand_path(File.dirname(__FILE__) + '/interface/thor/configuration')
|
9
|
+
require File.expand_path(File.dirname(__FILE__) + '/interface/thor/pomodoro')
|
10
|
+
require File.expand_path(File.dirname(__FILE__) + '/interface/thor/new')
|
11
|
+
require File.expand_path(File.dirname(__FILE__) + '/interface/thor/info')
|
9
12
|
|
10
13
|
|
11
|
-
|
14
|
+
module Fox
|
12
15
|
|
13
|
-
|
14
|
-
|
16
|
+
# @class Fox CLI Class
|
17
|
+
# @brief Implements the Fox CLI interface
|
18
|
+
class Cli < Thor
|
15
19
|
|
16
|
-
|
20
|
+
include Thor::Actions
|
17
21
|
|
22
|
+
package_name "Fox"
|
23
|
+
|
24
|
+
register Pomodoro, "pomodoro", "pomodoro [options]", "Pomodoro clock to help you concentrate"
|
25
|
+
tasks["pomodoro"].options = Pomodoro.class_options
|
26
|
+
|
27
|
+
register New, "new", "new [options]", "Create new paper project"
|
28
|
+
tasks["new"].options = New.class_options
|
29
|
+
|
30
|
+
register Info, "info", "info [options]", "Show information about Fox and its environment"
|
31
|
+
tasks["info"].options = Info.class_options
|
32
|
+
|
33
|
+
register Configuration, "configuration", "configuration [options]", "Handle global and directory local configurations"
|
34
|
+
tasks["configuration"].options = Configuration.class_options
|
35
|
+
|
36
|
+
end # of Class Cli
|
37
|
+
|
38
|
+
end # of Module Fox
|
39
|
+
|
40
|
+
#class CLI < Thor
|
41
|
+
# register(Version, 'version', 'version [something]', "Show current version")
|
42
|
+
# register(Configuration, 'config', 'config [something]', "Type for work with fox config")
|
43
|
+
# register(Pomodoro, 'pomodoro', 'pomodoro [something]', "Pomodoro clock to help you concentrate")
|
44
|
+
# register(New, 'new', 'new [something]', "Bookstrap new scientific paper project")
|
45
|
+
#
|
46
|
+
#end
|
47
|
+
#
|
File without changes
|
File without changes
|
File without changes
|
data/lib/fox/runner.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
|
4
|
+
# Custom
|
5
|
+
require_relative 'cli'
|
6
|
+
|
7
|
+
|
8
|
+
# @module Fox Module
|
9
|
+
# @brief Implements the Fox application
|
10
|
+
module Fox
|
11
|
+
|
12
|
+
# @class Fox Runner Class
|
13
|
+
# @brief Allow everything to be injected while defaulting to normal implementations.
|
14
|
+
class Runner
|
15
|
+
|
16
|
+
# @fn def initialize {{{
|
17
|
+
# @brief Construct the entry point with the signature needed for injection.
|
18
|
+
#
|
19
|
+
# @param [Array] argv
|
20
|
+
# @param [IO] stdin
|
21
|
+
# @param [IO] stdout
|
22
|
+
# @param [IO] stderr
|
23
|
+
# @param [Kernel] kernel
|
24
|
+
def initialize argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel
|
25
|
+
@argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
|
26
|
+
end # }}}
|
27
|
+
|
28
|
+
# @fn def execute! {{{
|
29
|
+
# @brief Run our normal Thor app the way we know and love.
|
30
|
+
def execute!
|
31
|
+
exit_code = begin
|
32
|
+
# Thor accesses these streams directly rather than letting them be injected, so we replace them.
|
33
|
+
$stderr = @stderr
|
34
|
+
$stdin = @stdin
|
35
|
+
$stdout = @stdout
|
36
|
+
|
37
|
+
# Fox::Cfg.load_configuration!
|
38
|
+
Fox::Cli.start(@argv)
|
39
|
+
|
40
|
+
# Thor::Base#start does not have a return value, assume success if no exception is raised.
|
41
|
+
0
|
42
|
+
rescue Exception => e
|
43
|
+
# Proxy any exception that comes out of Thor itself back to stderr.
|
44
|
+
$stderr.write(e.message + "\n")
|
45
|
+
|
46
|
+
# Exit with a failure code.
|
47
|
+
1
|
48
|
+
ensure
|
49
|
+
# ...then we put them back.
|
50
|
+
$stderr = STDERR
|
51
|
+
$stdin = STDIN
|
52
|
+
$stdout = STDOUT
|
53
|
+
end
|
54
|
+
|
55
|
+
# Proxy our exit code back to the injected kernel.
|
56
|
+
@kernel.exit(exit_code)
|
57
|
+
end # }}}
|
58
|
+
|
59
|
+
end # of Class Runner
|
60
|
+
|
61
|
+
end # of Module Fox
|
62
|
+
|
63
|
+
# vim:ts=2:tw=100:wm=100:syntax=ruby
|
data/lib/fox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bjoern Rennhak
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
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'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: fpm
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -415,7 +429,7 @@ files:
|
|
415
429
|
- lib/fox/interface/thor/configuration.rb
|
416
430
|
- lib/fox/interface/thor/create.rb
|
417
431
|
- lib/fox/interface/thor/default.rb
|
418
|
-
- lib/fox/interface/thor/info.
|
432
|
+
- lib/fox/interface/thor/info.rb
|
419
433
|
- lib/fox/interface/thor/init.rb
|
420
434
|
- lib/fox/interface/thor/mixin/audio.rb
|
421
435
|
- lib/fox/interface/thor/mixin/config.rb
|
@@ -434,13 +448,14 @@ files:
|
|
434
448
|
- lib/fox/interface/thor/mixin/model.rb
|
435
449
|
- lib/fox/interface/thor/mixin/network.rb
|
436
450
|
- lib/fox/interface/thor/mixin/shell.rb
|
437
|
-
- lib/fox/interface/thor/new.
|
438
|
-
- lib/fox/interface/thor/pomodoro.
|
451
|
+
- lib/fox/interface/thor/new.rb
|
452
|
+
- lib/fox/interface/thor/pomodoro.rb
|
439
453
|
- lib/fox/interface/thor/version.rb
|
440
454
|
- lib/fox/library/choice.rb
|
441
455
|
- lib/fox/library/logger.rb
|
442
456
|
- lib/fox/library/project_builder.rb
|
443
457
|
- lib/fox/library/secure_config.rb
|
458
|
+
- lib/fox/runner.rb
|
444
459
|
- lib/fox/version.rb
|
445
460
|
- spec/fox_spec.rb
|
446
461
|
- spec/spec_helper.rb
|