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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 857965e1b8fd0f5c481aa1675971cb6e6479cec3
4
- data.tar.gz: 0e1b11db7c1a364d0ee09eea0a2bbdfcf092d8d5
3
+ metadata.gz: be5201a58f9e94288879c098b0533b809cb74c99
4
+ data.tar.gz: eca1fcc17a0d10eb7a6b6bc7171974fd9dcd58fa
5
5
  SHA512:
6
- metadata.gz: 31e854ae25a1280da10618176c53d4edba426e9b2e3b6f598bb1d5dbbeb671bd2e265ff0e6e150ae4c7b5aad630e7c69f2f9118ca16781c5258f692c925d7b4f
7
- data.tar.gz: 8174e3766090b9d87a1649a1f4a08bd305829dcea65b4c8b10773eedac3c0fb0522c93b7b901cb50ec74cce5be625abc747b0d9489e4f6875a4da121476e8695
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
- require "simplecov"
16
+ require "simplecov"
20
17
 
21
- # Ensure merging of subprocesses by giving them a special name
22
- # SimpleCov.command_name ARGV.join(" ")
23
- SimpleCov.command_name "Fox #{Process.pid}"
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
- # Set the correct root folder for SimpleCov
26
- SimpleCov.root File.join(File.expand_path(File.dirname(__FILE__)), "..")
22
+ # Set the correct root folder for SimpleCov
23
+ SimpleCov.root File.join(File.expand_path(File.dirname(__FILE__)), "..")
27
24
 
28
- # Start coverage
29
- SimpleCov.start
25
+ # Start coverage
26
+ SimpleCov.start
30
27
  end # of if ENV
31
28
 
32
-
33
- # Fox::Runner.new( ARGV.dup ).execute!
34
- $thor_runner = true
35
-
36
- require File.expand_path("#{File.expand_path('../..', __FILE__)}/lib/fox/cli")
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
@@ -82,6 +82,7 @@ Gem::Specification.new do |spec|
82
82
 
83
83
  # General
84
84
  spec.add_runtime_dependency 'thor'
85
+ spec.add_runtime_dependency 'bundler'
85
86
 
86
87
  # Package building
87
88
  spec.add_runtime_dependency 'fpm'
data/lib/fox.rb CHANGED
@@ -7,32 +7,37 @@ require 'rake'
7
7
  require 'ruby-try'
8
8
 
9
9
 
10
- # @module module Fox
11
- # @brief Fox modules and classes namespace
12
- module Fox
13
-
14
- require_relative 'fox/version'
15
- require_relative 'fox/error'
16
-
17
- # @module module Mixin
18
- # @brief Mixin module contains various functions to be used in other components
19
- module Mixin
20
-
21
- # autoload :Guess, 'fox/mixin/'
22
-
23
- end # of module Mixing
24
-
25
- # autoload :Cache, 'fox/library/cache'
26
- # autoload :Choice, 'fox/library/choice'
27
-
28
-
29
- DEFAULT_CONFIG = '.fox/config.yaml'.freeze
30
-
31
- class << self
32
- end # of class << self
33
-
34
- end # of module Fox
35
-
36
- Default.start
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
@@ -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
- class CLI < Thor
14
+ module Fox
12
15
 
13
- register(Version, 'version', 'version [something]', "Show current version")
14
- register(Configuration, 'config', 'config [something]', "Type for work with fox config")
16
+ # @class Fox CLI Class
17
+ # @brief Implements the Fox CLI interface
18
+ class Cli < Thor
15
19
 
16
- end
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
+ #
@@ -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
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @module Fox Module
5
5
  # @brief Implements the Fox module wrapper around the Fox API
6
- class Fox
6
+ module Fox
7
7
 
8
8
  # Version of gem
9
9
  VERSION = `git describe --tags`.split("-").first || "0.1.0"
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.2
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.thor
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.thor
438
- - lib/fox/interface/thor/pomodoro.thor
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