txt_file_mutator 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1 +1,2 @@
1
- A history of changes to the gem...
1
+ 13-11-2009: Initial release
2
+
data/README CHANGED
@@ -0,0 +1,17 @@
1
+ txt_file_mutator
2
+ ================
3
+ Kristian Mandrup, kmandrup@gmail.com
4
+ ---
5
+
6
+ Contains utility functions for doing simple file mutations/transformations such as:
7
+
8
+ * Inserting content BEFORE a line with some specific content
9
+ * Inserting content AFTER a line with some specific content
10
+
11
+ * Commenting a line with some specific content
12
+ * Commenting a config.gem statement for a specific gem
13
+
14
+ * Remove a line
15
+ * Remove a require statement
16
+
17
+ (more to come in later versions...!)
data/README.rdoc CHANGED
@@ -1,6 +1,13 @@
1
1
  = txt_file_mutator
2
2
 
3
- Description goes here.
3
+ Contains utility functions for doing simple file mutations/transformations such as:
4
+ * Inserting content BEFORE a line with some specific content
5
+ * Inserting content AFTER a line with some specific content
6
+ * Commenting a line with some specific content
7
+ * Commenting a config.gem statement for a specific gem
8
+ * Remove a line
9
+ * Remove a require statement
10
+
4
11
 
5
12
  == Note on Patches/Pull Requests
6
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -17,10 +17,14 @@ module TextFileMutator
17
17
  end
18
18
  end
19
19
 
20
+ def self.remove_require(file, line)
21
+ gsub_file file, /(require.+'#{Regexp.escape(line)}'.+)/mi do |match|
22
+ ""
23
+ end
24
+ end
25
+
20
26
  def self.comment_line(file, line)
21
- puts "comment line: #{line}"
22
27
  gsub_file file, /^#?(#{Regexp.escape(line)})/mi do |match|
23
- puts "match: #{match}"
24
28
  "# " + "#{match}"
25
29
  end
26
30
  end
@@ -1,7 +1,7 @@
1
1
  require 'txt_file_mutator'
2
2
  require "test/unit"
3
3
 
4
- class TestFilterExec < Test::Unit::TestCase
4
+ class TestTxtFileMutator < Test::Unit::TestCase
5
5
 
6
6
  def setup
7
7
  @tfm = TextFileMutator
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txt_file_mutator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristian Mandrup