learn_writer 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/learn-write +8 -3
- data/lib/learn_writer.rb +12 -12
- data/lib/learn_writer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f54bb10df3efea623e1e1d40cc86243fb37075d
|
4
|
+
data.tar.gz: 187e6765cceb9a3f3c230c9cdce1326c395a8d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e6ca5c506eb0e3c2fa9c83e32ffcba1b5755863bd6d3f74d73b4fcfdbe62d6f68375abf70469a2a05586aca7d9a1023fe7ba26664517617760f4c19ac78d4e9
|
7
|
+
data.tar.gz: b3f0fb740664f4f471ef96b322e7b505d6c01aabd9b42f309d167df1a70c79e62b8d5a71cffafcb1e87a5a13c450746a7986ce8d55d97f7f617d542cbc6608fd
|
data/bin/learn-write
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require_relative '../lib/learn_writer.rb'
|
3
3
|
|
4
|
-
|
5
|
-
dir = Dir.pwd
|
6
|
-
LearnWriter.new(dir).write_metadata
|
4
|
+
if ARGV.length == 0
|
5
|
+
dir = Dir.pwd
|
6
|
+
LearnWriter.new(dir).write_metadata
|
7
|
+
elsif ARGV.length == 1
|
8
|
+
LearnWriter.new(ARGV[0]).write_metadata
|
9
|
+
else
|
10
|
+
puts 'please use learn-write <directory name> or run learn-write from within the directory you want to add metadata to because you just cannot even'
|
11
|
+
end
|
7
12
|
|
data/lib/learn_writer.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'pry'
|
2
3
|
|
3
4
|
class LearnWriter
|
4
5
|
|
@@ -20,24 +21,23 @@ class LearnWriter
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def write_dot_learn
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
File.open(file, 'w') { |file| file.write(dot_learn_content) }
|
24
|
+
unless Dir.entries(filepath).include?('.learn')
|
25
|
+
create_and_write_file(".learn", VALID_DOT_LEARN)
|
26
|
+
end
|
27
27
|
end
|
28
28
|
|
29
29
|
def write_contributing
|
30
|
-
|
31
|
-
contributing_content = File.read(VALID_CONTRIBUTING)
|
32
|
-
file = FileUtils.touch(contributing)[0]
|
33
|
-
File.open(file, 'w') { |file| file.write(contributing_content) }
|
30
|
+
create_and_write_file("CONTRIBUTING.md", VALID_CONTRIBUTING)
|
34
31
|
end
|
35
32
|
|
36
33
|
def write_license
|
37
|
-
|
38
|
-
|
39
|
-
file = FileUtils.touch(license)[0]
|
40
|
-
File.open(file, 'w') { |file| file.write(license_content) }
|
34
|
+
create_and_write_file("LICENSE.md", VALID_LICENSE)
|
35
|
+
end
|
41
36
|
|
37
|
+
def create_and_write_file(file_name, file_content)
|
38
|
+
file_name = "#{filepath}/#{file_name}"
|
39
|
+
file_content = File.read(file_content)
|
40
|
+
file = FileUtils.touch(file_name)[0]
|
41
|
+
File.open(file, 'w') { |file| file.write(file_content) }
|
42
42
|
end
|
43
43
|
end
|
data/lib/learn_writer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: learn_writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sophie DeBenedetto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|