buzzcore 0.2.5 → 0.2.6

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.
data/README.rdoc CHANGED
@@ -17,7 +17,7 @@ Core library of Buzzware Solutions
17
17
  == INSTALL:
18
18
 
19
19
  sudo gem sources -a http://gems.github.com
20
- sudo gem install buzzware-buzzcore
20
+ sudo gem install buzzcore
21
21
 
22
22
  == LICENSE:
23
23
 
data/Rakefile CHANGED
@@ -11,12 +11,14 @@ begin
11
11
  gem.homepage = "http://github.com/buzzware/buzzcore"
12
12
  gem.authors = ["buzzware"]
13
13
  #gem.rubyforge_project = "buzzware"
14
+ gem.add_dependency "shairontoledo-popen4"
14
15
  gem.add_development_dependency "thoughtbot-shoulda"
15
16
  gem.files.include %w(
16
17
  lib/buzzcore.rb
17
18
  )
18
19
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
20
  end
21
+ Jeweler::GemcutterTasks.new
20
22
  Jeweler::RubyforgeTasks.new do |rubyforge|
21
23
  rubyforge.doc_task = "rdoc"
22
24
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
data/buzzcore.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{buzzcore}
8
- s.version = "0.2.5"
8
+ s.version = "0.2.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["buzzware"]
12
- s.date = %q{2009-10-06}
12
+ s.date = %q{2009-12-08}
13
13
  s.description = %q{buzzcore is the ruby core library developed and used by Buzzware Solutions.}
14
14
  s.email = %q{contact@buzzware.com.au}
15
15
  s.extra_rdoc_files = [
@@ -48,11 +48,10 @@ Gem::Specification.new do |s|
48
48
  "test/shell_test.rb",
49
49
  "test/test_helper.rb"
50
50
  ]
51
- s.has_rdoc = true
52
51
  s.homepage = %q{http://github.com/buzzware/buzzcore}
53
52
  s.rdoc_options = ["--charset=UTF-8"]
54
53
  s.require_paths = ["lib"]
55
- s.rubygems_version = %q{1.3.1}
54
+ s.rubygems_version = %q{1.3.5}
56
55
  s.summary = %q{buzzcore is the ruby core library developed and used by Buzzware Solutions.}
57
56
  s.test_files = [
58
57
  "test/buzzcore_test.rb",
@@ -64,14 +63,17 @@ Gem::Specification.new do |s|
64
63
 
65
64
  if s.respond_to? :specification_version then
66
65
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
67
- s.specification_version = 2
66
+ s.specification_version = 3
68
67
 
69
68
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
69
+ s.add_runtime_dependency(%q<shairontoledo-popen4>, [">= 0"])
70
70
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
71
71
  else
72
+ s.add_dependency(%q<shairontoledo-popen4>, [">= 0"])
72
73
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
73
74
  end
74
75
  else
76
+ s.add_dependency(%q<shairontoledo-popen4>, [">= 0"])
75
77
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
76
78
  end
77
79
  end
@@ -99,14 +99,26 @@ module MiscUtils
99
99
  end
100
100
  end
101
101
 
102
+ def self.set_permissions_cmd(aFilepath,aUser=nil,aGroup=nil,aMode=nil,aSetGroupId=false,aSudo=true)
103
+ cmd = []
104
+ if aGroup
105
+ cmd << (aUser ? "#{aSudo ? sudo : ''} chown #{aUser}:#{aGroup}" : "#{aSudo ? sudo : ''} chgrp #{aGroup}") + " #{aFilepath}"
106
+ else
107
+ cmd << "#{aSudo ? sudo : ''} chown #{aUser} #{aFilepath}" if aUser
108
+ end
109
+ cmd << "#{aSudo ? sudo : ''} chmod #{aMode.to_s} #{aFilepath}" if aMode
110
+ cmd << "#{aSudo ? sudo : ''} chmod g+s #{aFilepath}" if aSetGroupId
111
+ cmd.join(' && ')
112
+ end
113
+
102
114
  def self.string_to_file(aString,aFilename)
103
- File.open(aFilename,'wb') {|file| file.puts aString }
115
+ File.open(aFilename,'wb') {|file| file.write aString }
104
116
  end
105
117
 
106
118
  def self.string_from_file(aFilename)
107
119
  result = nil
108
120
  File.open(aFilename, "rb") { |f| result = f.read }
109
- return result && result[0..-2] # quick hack to stop returning false \n at end
121
+ # return result && result[0..-2] # quick hack to stop returning false \n at end UPDATE: this is causing problems now
110
122
  end
111
123
 
112
124
  def self.sniff_seperator(aPath)
@@ -160,6 +172,12 @@ module MiscUtils
160
172
  File.basename(remove_slash(aPath))
161
173
  end
162
174
 
175
+ def self.simple_file_name(aPath)
176
+ f = File.basename(aPath)
177
+ dot = f.index('.')
178
+ return dot ? f[0,dot] : f
179
+ end
180
+
163
181
  def self.path_parts(aPath)
164
182
  sep = sniff_seperator(aPath)
165
183
  aPath.split(sep)
@@ -52,12 +52,12 @@ module StringUtils
52
52
  def self.split3(aString,aPattern,aOccurence=0)
53
53
  matches = aString.scan_md(aPattern)
54
54
  match = matches[aOccurence]
55
- parts = [match.pre_match,match.to_s,match.post_match]
55
+ parts = match ? [match.pre_match,match.to_s,match.post_match] : [aString,nil,'']
56
56
 
57
57
  if !block_given? # return head,match,tail
58
58
  parts
59
59
  else # return string
60
- parts[1] = yield *parts
60
+ parts[1] = yield *parts if match
61
61
  parts.join
62
62
  end
63
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buzzcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzzware
@@ -9,9 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-06 00:00:00 +08:00
12
+ date: 2009-12-08 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: shairontoledo-popen4
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
15
25
  - !ruby/object:Gem::Dependency
16
26
  name: thoughtbot-shoulda
17
27
  type: :development
@@ -63,6 +73,8 @@ files:
63
73
  - test/test_helper.rb
64
74
  has_rdoc: true
65
75
  homepage: http://github.com/buzzware/buzzcore
76
+ licenses: []
77
+
66
78
  post_install_message:
67
79
  rdoc_options:
68
80
  - --charset=UTF-8
@@ -83,9 +95,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
95
  requirements: []
84
96
 
85
97
  rubyforge_project:
86
- rubygems_version: 1.3.1
98
+ rubygems_version: 1.3.5
87
99
  signing_key:
88
- specification_version: 2
100
+ specification_version: 3
89
101
  summary: buzzcore is the ruby core library developed and used by Buzzware Solutions.
90
102
  test_files:
91
103
  - test/buzzcore_test.rb