dev_commands 0.0.6 → 0.0.7

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: c9172a254dca436cd1ae2b8c87126a7640371e49
4
- data.tar.gz: b3b4d0264b2de92e4f5a3076de7bcd62192e37a6
3
+ metadata.gz: 387fefe39cf6b1995bf4fc7f148383a7dff9d1df
4
+ data.tar.gz: fb17b16fa43b70947b40b45ea79e0179b89770c8
5
5
  SHA512:
6
- metadata.gz: 15c8d7c143dca42534965ed376af389ffde7e184e60809ddcfe8ab6bd614efaf942a0dfecf241d6e23b6ebab41952589aaab546fe1236c600a428f0bbde90283
7
- data.tar.gz: dfee1127ace3bb8305f0ef27ccfa6c2a98290ca2b7a5c49b2264a12639193f50950766a733e621ac8969df3cef61192bf404ee7afe5843236e91cf1e1e5c680a
6
+ metadata.gz: b88dc36d380987a06144aebc8e79aa5e87ab062ee53355c436019216e825a31af5f5c7d9df6edeba397679aa3a67f39a4097e35041d0d0c9a6c0b54c830dd7d9
7
+ data.tar.gz: 992e094f9357b76d3b25d425d848da9bb08f3d3ca5d4826be3d8d12a46994477d1ecfea2b328afa9ff285f9128d66eb8535a4535d564748e1229abd574b15ffb
@@ -41,11 +41,12 @@ class Command < Hash
41
41
  ruby = self[:input].gsub("<%","").gsub("%>","")
42
42
 
43
43
  begin
44
- puts "eval(#{ruby})"
44
+ #puts "eval(#{ruby})"
45
45
  self[:output]=eval(ruby)
46
46
  rescue
47
- puts "unable to eval(#{ruby})"
48
- raise "unable to eval(#{ruby})"
47
+ #puts "unable to eval(#{ruby})"
48
+ #raise "unable to eval(#{ruby})"
49
+ self[:error]="unable to eval(#{ruby})"
49
50
  end
50
51
 
51
52
  self[:elapsed] = timer.elapsed_str
@@ -1,3 +1,4 @@
1
1
  require 'json'
2
2
  require 'systemu'
3
- require_relative('command.rb')
3
+ require_relative('command.rb')
4
+ require_relative('text.rb')
@@ -0,0 +1,14 @@
1
+ class Text
2
+ def self.replace_in_glob(glob,search,replace)
3
+ Dir.glob(glob).each{ |f| replace_text_in_file(f,search,replace) }
4
+ end
5
+
6
+ def self.replace_in_file(filename,search,replace)
7
+ text1 = File.read(filename)
8
+ text2 = text1.gsub(search) { |str| str=replace }
9
+ unless text1==text2
10
+ File.open(filename,"w") { |f| f.puts text2 }
11
+ end
12
+ end
13
+
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-09 00:00:00.000000000 Z
11
+ date: 2015-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -76,6 +76,7 @@ files:
76
76
  - lib/command.rb
77
77
  - lib/dev_commands.rb
78
78
  - lib/hash.rb
79
+ - lib/text.rb
79
80
  - lib/timer.rb
80
81
  - spec/command_spec.rb
81
82
  - LICENSE