cut_to_files 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/cut_to_files.rb +17 -0
  3. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4647d286b2bac8ecd2cc3353f72a58441e98fd2f
4
+ data.tar.gz: d47872115b9413aa01d1cda435462b42552daf53
5
+ SHA512:
6
+ metadata.gz: 69202995b96235354576bb27602c0645731407fb8daa74d1b256efb8fc404e79b93c460e046e7132f6e892fb37d5e68e49e581bd6b40559290ddec0fcd8421d4
7
+ data.tar.gz: 0a6cda83323627ae8aa7226644720c443a9b9db7aaeb275e5c1a405feb2a4d079ad6e35f06ab234d863458099321a6e787d34ab160871b322821bac9f31d2e0c
@@ -0,0 +1,17 @@
1
+ require 'fileutils'
2
+
3
+ class String
4
+ def cut_to_files
5
+ f = $stdout
6
+ self.lines.map{|l|
7
+ if l =~ /^--(.*)\/(.*)\s*$/
8
+ f.close if f != $stdout
9
+ FileUtils.mkdir_p $1
10
+ f = File.open($1 + '/' + $2, 'w')
11
+ next
12
+ end
13
+ f.puts l
14
+ }
15
+ f.close
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cut_to_files
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - u89012
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Handy when generating massive amounts of code and need a way to split
14
+ the output into separate files
15
+ email: u89012@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/cut_to_files.rb
21
+ homepage: http://github.com/u89012/cut_to_files
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.2.2
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Cuts a (large) string into files at the markers provided
45
+ test_files: []