learn_writer 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/bin/learn-write +0 -0
- data/lib/learn_writer.rb +22 -11
- data/lib/learn_writer/valid_contributing.md +1 -1
- 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: 3fd4af31185de495f5443cfb8ff3766f3a7b7a73
|
4
|
+
data.tar.gz: 246d1abc79873ef5574a5ef6f975dcfc8ee0bc22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ab32ccebda63a057bb9fa25f0a715fdbdb454d387e05d0589f3afb19a8252dc8104c4e58e2c6f005b78e260f74cf3b8fe1bfacb497ae14b9d82291b86ebf336
|
7
|
+
data.tar.gz: 59de14fc15993528248224e9c415e644ce68775540736f9b6f3680e9a68d3f7c6755d5c4666b29e9be4dd3dff28b30703e2b626d9a8e0cbe5700c33f06e69749
|
data/bin/learn-write
CHANGED
File without changes
|
data/lib/learn_writer.rb
CHANGED
@@ -2,12 +2,13 @@ require 'fileutils'
|
|
2
2
|
require 'pry'
|
3
3
|
|
4
4
|
class LearnWriter
|
5
|
-
|
5
|
+
VALID_DOT_EDITORCONFIG = File.open(File.expand_path(File.dirname(__FILE__)) + '/learn_writer/valid_dot_editorconfig')
|
6
|
+
VALID_DOT_GITIGNORE = File.open(File.expand_path(File.dirname(__FILE__)) + '/learn_writer/valid_dot_gitignore')
|
6
7
|
VALID_DOT_LEARN = File.open(File.expand_path(File.dirname(__FILE__)) + '/learn_writer/valid_dot_learn.yml')
|
7
8
|
VALID_CONTRIBUTING = File.open(File.expand_path(File.dirname(__FILE__)) + '/learn_writer/valid_contributing.md')
|
8
9
|
VALID_LICENSE = File.open(File.expand_path(File.dirname(__FILE__)) + '/learn_writer/valid_license.md')
|
9
10
|
|
10
|
-
|
11
|
+
|
11
12
|
attr_accessor :filepath
|
12
13
|
|
13
14
|
def initialize(filepath)
|
@@ -15,15 +16,23 @@ class LearnWriter
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def write_metadata
|
19
|
+
write_dot_editorconfig
|
20
|
+
write_dot_gitignore
|
18
21
|
write_dot_learn
|
19
22
|
write_contributing
|
20
23
|
write_license
|
21
24
|
end
|
22
25
|
|
26
|
+
def write_dot_editorconfig
|
27
|
+
create_and_write_file('.editorconfig', VALID_DOT_EDITORCONFIG, false)
|
28
|
+
end
|
29
|
+
|
30
|
+
def write_dot_gitignore
|
31
|
+
create_and_write_file('.gitignore', VALID_DOT_GITIGNORE, false)
|
32
|
+
end
|
33
|
+
|
23
34
|
def write_dot_learn
|
24
|
-
|
25
|
-
create_and_write_file(".learn", VALID_DOT_LEARN)
|
26
|
-
end
|
35
|
+
create_and_write_file(".learn", VALID_DOT_LEARN, false)
|
27
36
|
end
|
28
37
|
|
29
38
|
def write_contributing
|
@@ -34,10 +43,12 @@ class LearnWriter
|
|
34
43
|
create_and_write_file("LICENSE.md", VALID_LICENSE)
|
35
44
|
end
|
36
45
|
|
37
|
-
def create_and_write_file(file_name, file_content)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
46
|
+
def create_and_write_file(file_name, file_content, overwrite=true)
|
47
|
+
if overwrite || !Dir.entries(filepath).include?(file_name)
|
48
|
+
file_name = "#{filepath}/#{file_name}"
|
49
|
+
file_content = File.read(file_content)
|
50
|
+
file = FileUtils.touch(file_name)[0]
|
51
|
+
File.open(file, 'w') { |f| f.write(file_content) }
|
52
|
+
end
|
42
53
|
end
|
43
|
-
end
|
54
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Contributing to Learn.co Curriculum
|
2
2
|
|
3
|
-
We're really
|
3
|
+
We're really excited that you're about to contribute to the [open curriculum](https://learn.co/content-license) on [Learn.co](https://learn.co). If this is your first time contributing, please continue reading to learn how to make the most meaningful and useful impact possible.
|
4
4
|
|
5
5
|
## Raising an Issue to Encourage a Contribution
|
6
6
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sophie DeBenedetto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|