learn-tool 0.0.23 → 0.0.24

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
  SHA256:
3
- metadata.gz: 8a512d49360188f0eb9556ec11b02fc47a7fbee31216c45d92ebdf1407265e39
4
- data.tar.gz: 635870bc64c05d5b994c3a45c2b38565a5e53012c6abe46222f398af8aa8e0a3
3
+ metadata.gz: b08f60f709bc3833f5fd5fcc540f2fcbc2300a3b86f75d65ef49a5e3b79e3b81
4
+ data.tar.gz: 85eaf907397aac0bdd656ddef86fddcd1d36b8fe4324b9f064cc0932d75ffbc9
5
5
  SHA512:
6
- metadata.gz: a9baa9b7a741ce181470fa7f051641d737f7f80fb8da4b2e7bdc4ef8dffa14df1ae576cf124f9bafab33dbb9fba7049521addeccbeb076edb3c512a3d678b175
7
- data.tar.gz: eaec1d1f16e457a2ea30a2dba75db7f716987bbacfc01eeda1fde853452c9cc46508c7612454c3fbdd70a10bcf212a7aaa2719503272a1ff717da5564cd2bc85
6
+ metadata.gz: a3c69cbdfab24f8c7da07850bedb6031c2f53d4ec23d48bf0e335d7a37a0b20ec382aadeb791a1f98ec5b53c6c84c88d0c899093bf6b3398777fabb1eb1782d4
7
+ data.tar.gz: d2176a1da36ae242108baf1065dfdeac69c65c5a819ac5929b9de5a296fe4eff3a5d3eb1abad32f79a2184555d79fcc1e737c175d54d0f23e9a34ffc1ffebab0
data/LICENSE.md CHANGED
@@ -1,23 +0,0 @@
1
- # Learn.co Educational Content License
2
-
3
- Copyright (c) 2015 Flatiron School, Inc
4
-
5
- The Flatiron School, Inc. owns this Educational Content. However, the Flatiron
6
- School supports the development and availability of educational materials in the
7
- public domain. Therefore, the Flatiron School grants Users of the Flatiron
8
- Educational Content set forth in this repository certain rights to reuse, build
9
- upon and share such Educational Content subject to the terms of the Educational
10
- Content License set forth [here](http://learn.co/content-license)
11
- (http://learn.co/content-license). You must read carefully the terms and
12
- conditions contained in the Educational Content License as such terms govern
13
- access to and use of the Educational Content.
14
-
15
- Flatiron School is willing to allow you access to and use of the Educational
16
- Content only on the condition that you accept all of the terms and conditions
17
- contained in the Educational Content License set forth
18
- [here](http://learn.co/content-license) (http://learn.co/content-license). By
19
- accessing and/or using the Educational Content, you are agreeing to all of the
20
- terms and conditions contained in the Educational Content License. If you do
21
- not agree to any or all of the terms of the Educational Content License, you are
22
- prohibited from accessing, reviewing or using in any way the Educational
23
- Content.
data/bin/learn-tool CHANGED
@@ -42,6 +42,10 @@ OptionParser.new do |opts|
42
42
  "Add correct files to a directory given its absolute path. If blank, edits current directory") do |filepath|
43
43
  filepath ? options[:repair] = filepath : options[:repair] = Dir.pwd
44
44
  end
45
+ opts.on("-v", "--version",
46
+ "Returns the current learn-tool version") do |v|
47
+ options[:version] = true
48
+ end
45
49
 
46
50
  end.parse!
47
51
 
@@ -61,6 +65,10 @@ if options[:repair]
61
65
  LearnTool.new(mode: "repair", filepath: options[:repair])
62
66
  end
63
67
 
68
+ if options[:version]
69
+ LearnTool.new(mode: "version", filepath: Dir.pwd)
70
+ end
71
+
64
72
  if options == {}
65
73
  LearnTool.new(mode: "lint", filepath: Dir.pwd)
66
74
  end
@@ -1,9 +1,9 @@
1
1
  class ContributingLinter
2
2
 
3
- VALID_FILE = File.open(File.expand_path(File.dirname(__FILE__)) + '/support_files/CONTRIBUTING.md')
3
+ VALID_FILE = File.open(File.expand_path(File.dirname(__FILE__)) + '/support_files/CONTRIBUTING.md', "r:UTF-8")
4
4
 
5
5
  def self.parse_file(file, learn_error)
6
- directory_file = sanitize_whitespace(File.open(file).read)
6
+ directory_file = sanitize_whitespace(File.open(file, "r:UTF-8").read)
7
7
  valid_file_array = sanitize_whitespace(VALID_FILE.read)
8
8
  diff = directory_file - valid_file_array
9
9
 
@@ -1,10 +1,10 @@
1
1
  class LicenseLinter
2
2
 
3
- VALID_FILE = File.open(File.expand_path(File.dirname(__FILE__)) + '/support_files/LICENSE.md')
3
+ VALID_FILE = File.open(File.expand_path(File.dirname(__FILE__)) + '/support_files/LICENSE.md', "r:UTF-8")
4
4
  VALID_YEARS = ["2015","2016","2017","2018","2019","2020","2021","2022","2023","2024","2025"]
5
5
 
6
6
  def self.parse_file(file, learn_error)
7
- directory_file_array = sanitize_whitespace(File.open(file).read)
7
+ directory_file_array = sanitize_whitespace(File.open(file, "r:UTF-8").read)
8
8
  valid_file_array = sanitize_whitespace(VALID_FILE.read)
9
9
  diff = directory_file_array - valid_file_array
10
10
 
@@ -0,0 +1,3 @@
1
+ class LearnTool
2
+ VERSION = "0.0.24"
3
+ end
data/lib/learn-tool.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'faraday'
2
2
  require 'uri'
3
3
  require 'open3'
4
+ require_relative './learn-tool/version'
4
5
  require_relative './learn-tool/learn-base'
5
6
  require_relative './learn-tool/learn-repair'
6
7
  require_relative './learn-tool/learn-create'
@@ -13,9 +14,13 @@ require_relative './learn-tool/yaml-linter'
13
14
  require_relative './learn-tool/contributing-linter'
14
15
 
15
16
  class LearnTool
16
-
17
17
 
18
18
  def initialize(mode:, filepath:Dir.pwd)
19
+ if mode == 'version'
20
+ puts VERSION
21
+ return
22
+ end
23
+
19
24
  puts "Learn-tool will #{mode} at the following location: #{filepath}"
20
25
  if mode == 'create'
21
26
  LearnCreate.new(filepath)
@@ -32,6 +37,8 @@ class LearnTool
32
37
  if mode == 'lint'
33
38
  LearnLinter.new(filepath).lint_directory
34
39
  end
40
+
41
+
35
42
  end
36
43
 
37
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learn-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - flatironschool
@@ -49,6 +49,7 @@ files:
49
49
  - lib/learn-tool/readme-linter.rb
50
50
  - lib/learn-tool/support_files/CONTRIBUTING.md
51
51
  - lib/learn-tool/support_files/LICENSE.md
52
+ - lib/learn-tool/version.rb
52
53
  - lib/learn-tool/yaml-linter.rb
53
54
  homepage: https://github.com/learn-co-curriculum/learn-tool
54
55
  licenses: