boson 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  require 'rubygems' unless Object.const_defined?(:Gem)
3
3
  require File.dirname(__FILE__) + "/lib/boson/version"
4
-
4
+
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "boson"
7
7
  s.version = Boson::VERSION
@@ -14,11 +14,12 @@ Gem::Specification.new do |s|
14
14
  s.executables = ['boson']
15
15
  s.add_dependency 'hirb', '>= 0.5.0'
16
16
  s.add_dependency 'alias', '>= 0.2.2'
17
- s.add_development_dependency 'mocha'
17
+ s.add_development_dependency 'mocha', '= 0.9.8'
18
18
  s.add_development_dependency 'bacon', '>= 1.1.0'
19
19
  s.add_development_dependency 'mocha-on-bacon'
20
20
  s.add_development_dependency 'bacon-bits'
21
- s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
21
+ s.add_development_dependency 'rake'
22
+ s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec .travis.yml}
22
23
  s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
23
24
  s.license = 'MIT'
24
25
  end
@@ -0,0 +1,4 @@
1
+ before_install: bundle init --gemspec=.gemspec
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
@@ -1,3 +1,6 @@
1
+ = 0.4.0
2
+ * Add file lock for concurrent processes
3
+
1
4
  == 0.3.4
2
5
  * Handle rubygems deprecation (#28)
3
6
  * 1.9 Fixes
@@ -7,6 +7,13 @@ being usable from irb and the commandline, optional automated views generated by
7
7
  libraries to be written as plain ruby. For my libraries that use this, see
8
8
  {irbfiles}[http://github.com/cldwalker/irbfiles]. Works with all major ruby versions.
9
9
 
10
+ == UPDATE
11
+ Boson 0.4.x will be the last 1.8 compatible version.
12
+ Boson 0.5 will be a rewrite compatible with only 1.9. Work is going on in {boson2
13
+ branch}[https://github.com/cldwalker/boson/tree/boson2]. The goal of boson2 is to have a slimmer
14
+ core, move everything else {to plugins}[https://github.com/cldwalker/boson-all]
15
+ and to allow gems to use boson to make executables like thor.
16
+
10
17
  == Features
11
18
  * Simple organization: Commands are just methods on an object (default is main) and command libraries are just modules.
12
19
  * Commands are accessible from the commandline (Boson::BinRunner) or irb (Boson::ConsoleRunner).
@@ -171,4 +178,4 @@ Boson stands on the shoulders of these people and their ideas:
171
178
  * Dave Thomas for scraping a method's comments (Boson::CommentInspector)
172
179
  * Mauricio Fernandez for scraping a method's arguments (Boson::ArgumentInspector)
173
180
  * Chris Wanstrath for inspiring Boson's libraries with Rip's packages.
174
- * And its contributors: @mirell
181
+ * And its contributors: @mirell, @martinos
@@ -2,10 +2,10 @@ require 'digest/md5'
2
2
  module Boson
3
3
  # This class provides an index for commands and libraries of a given a Repo.
4
4
  # When this index updates, it detects library files whose md5 hash have changed and reindexes them.
5
- # The index is stored with Marshal at config/index.marshal (relative to a Repo's root directory).
5
+ # The index is stored with Marshal at config/index.marshal (relative to a Repo's root directory).
6
6
  # Since the index is marshaled, putting lambdas/procs in it will break it.If an index gets corrupted,
7
7
  # simply delete it and next time Boson needs it, the index will be recreated.
8
-
8
+
9
9
  class RepoIndex
10
10
  attr_reader :libraries, :commands, :repo
11
11
  def initialize(repo)
@@ -35,7 +35,10 @@ module Boson
35
35
  def read
36
36
  return if @read
37
37
  @libraries, @commands, @lib_hashes = exists? ?
38
- File.open( marshal_file, 'rb' ){|f| Marshal.load( f.read ) } : [[], [], {}]
38
+ File.open(marshal_file, 'rb') do |f|
39
+ f.flock(File::LOCK_EX)
40
+ Marshal.load(f)
41
+ end : [[], [], {}]
39
42
  delete_stale_libraries_and_commands
40
43
  set_command_namespaces
41
44
  @read = true
@@ -63,7 +66,15 @@ module Boson
63
66
  end
64
67
 
65
68
  def save_marshal_index(marshal_string)
66
- File.open(marshal_file, 'wb') {|f| f.write marshal_string }
69
+ binmode = defined?(File::BINARY) ? File::BINARY : 0
70
+ rdwr_access = File::RDWR | File::CREAT | binmode
71
+ # To protect the file truncing with a lock we cannot use the 'wb' options.
72
+ # The w option truncates the file before calling the File.open block
73
+ File.open(marshal_file, rdwr_access) do |f|
74
+ f.flock(File::LOCK_EX)
75
+ f.truncate 0
76
+ f.write(marshal_string)
77
+ end
67
78
  end
68
79
 
69
80
  def delete_stale_libraries_and_commands
@@ -121,4 +132,4 @@ module Boson
121
132
  end
122
133
  #:startdoc:
123
134
  end
124
- end
135
+ end
@@ -1,3 +1,3 @@
1
1
  module Boson
2
- VERSION = '0.3.4'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -1,4 +1,5 @@
1
- mocha >=0
1
+ mocha =0.9.8
2
2
  bacon >=1.1.0
3
3
  mocha-on-bacon >=0
4
- bacon-bits >=0
4
+ bacon-bits >=0
5
+ rake >=0
metadata CHANGED
@@ -1,94 +1,106 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: boson
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
4
5
  prerelease:
5
- version: 0.3.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Gabriel Horner
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-15 00:00:00 -04:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-11 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: hirb
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70363074549740 !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
24
21
  version: 0.5.0
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: alias
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70363074549740
25
+ - !ruby/object:Gem::Dependency
26
+ name: alias
27
+ requirement: &70363074548940 !ruby/object:Gem::Requirement
31
28
  none: false
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
35
32
  version: 0.2.2
36
33
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: mocha
40
34
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70363074548940
36
+ - !ruby/object:Gem::Dependency
37
+ name: mocha
38
+ requirement: &70363074548340 !ruby/object:Gem::Requirement
42
39
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: "0"
40
+ requirements:
41
+ - - =
42
+ - !ruby/object:Gem::Version
43
+ version: 0.9.8
47
44
  type: :development
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: bacon
51
45
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70363074548340
47
+ - !ruby/object:Gem::Dependency
48
+ name: bacon
49
+ requirement: &70363074547880 !ruby/object:Gem::Requirement
53
50
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
57
54
  version: 1.1.0
58
55
  type: :development
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: mocha-on-bacon
62
56
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70363074547880
58
+ - !ruby/object:Gem::Dependency
59
+ name: mocha-on-bacon
60
+ requirement: &70363074547500 !ruby/object:Gem::Requirement
64
61
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
69
66
  type: :development
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
67
+ prerelease: false
68
+ version_requirements: *70363074547500
69
+ - !ruby/object:Gem::Dependency
72
70
  name: bacon-bits
71
+ requirement: &70363074547000 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
73
78
  prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
79
+ version_requirements: *70363074547000
80
+ - !ruby/object:Gem::Dependency
81
+ name: rake
82
+ requirement: &70363074546540 !ruby/object:Gem::Requirement
75
83
  none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
80
88
  type: :development
81
- version_requirements: *id006
82
- description: Boson is a command/task framework with the power to turn any ruby method into a full-fledged executable with options. Some unique features that differentiate it from rake and thor include being usable from irb and the commandline, optional automated views generated by hirb and allowing libraries to be written as plain ruby. For my libraries that use this, see irbfiles. Works with all major ruby versions.
89
+ prerelease: false
90
+ version_requirements: *70363074546540
91
+ description: Boson is a command/task framework with the power to turn any ruby method
92
+ into a full-fledged executable with options. Some unique features that differentiate
93
+ it from rake and thor include being usable from irb and the commandline, optional
94
+ automated views generated by hirb and allowing libraries to be written as plain
95
+ ruby. For my libraries that use this, see irbfiles. Works with all major ruby versions.
83
96
  email: gabriel.horner@gmail.com
84
- executables:
97
+ executables:
85
98
  - boson
86
99
  extensions: []
87
-
88
- extra_rdoc_files:
100
+ extra_rdoc_files:
89
101
  - README.rdoc
90
102
  - LICENSE.txt
91
- files:
103
+ files:
92
104
  - lib/boson/command.rb
93
105
  - lib/boson/commands/core.rb
94
106
  - lib/boson/commands/web_core.rb
@@ -148,33 +160,31 @@ files:
148
160
  - test/deps.rip
149
161
  - Rakefile
150
162
  - .gemspec
151
- has_rdoc: true
163
+ - .travis.yml
152
164
  homepage: http://tagaholic.me/boson/
153
- licenses:
165
+ licenses:
154
166
  - MIT
155
167
  post_install_message:
156
168
  rdoc_options: []
157
-
158
- require_paths:
169
+ require_paths:
159
170
  - lib
160
- required_ruby_version: !ruby/object:Gem::Requirement
171
+ required_ruby_version: !ruby/object:Gem::Requirement
161
172
  none: false
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: "0"
166
- required_rubygems_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ! '>='
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ required_rubygems_version: !ruby/object:Gem::Requirement
167
178
  none: false
168
- requirements:
169
- - - ">="
170
- - !ruby/object:Gem::Version
179
+ requirements:
180
+ - - ! '>='
181
+ - !ruby/object:Gem::Version
171
182
  version: 1.3.6
172
183
  requirements: []
173
-
174
184
  rubyforge_project:
175
- rubygems_version: 1.6.2
185
+ rubygems_version: 1.8.10
176
186
  signing_key:
177
187
  specification_version: 3
178
- summary: A command/task framework similar to rake and thor that opens your ruby universe to the commandline and irb.
188
+ summary: A command/task framework similar to rake and thor that opens your ruby universe
189
+ to the commandline and irb.
179
190
  test_files: []
180
-