learn-co 2.3.11 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/learn/internet_connection.rb +5 -0
- data/lib/learn/options_sanitizer.rb +23 -7
- data/lib/learn/version.rb +1 -1
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 032d77d464ab5bb85949f3881a337051ca3731e5
|
4
|
+
data.tar.gz: 41ae323286acca22153b1c57b9d4879079daa29b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95bf189b416e1ee61dddd01054dbd224baf77e7440dfef5e4cd1d8d9a9558fdf57eb10b654d4719b3d6ba2d0b90a0e267995cd175f709e3016e91452e67cb93c
|
7
|
+
data.tar.gz: 2ee3199e51ca6dc540b52c3c156bcad7de5ba8fff2292bd8a1bf3617c08ad0a41566c45a57f68eb80e31823aed7b3715dd76ffceb1a10e83fa642b12aabff45c
|
@@ -49,6 +49,11 @@ module Learn
|
|
49
49
|
self.connection = false
|
50
50
|
puts NO_INTERNET_MESSAGE if !silent
|
51
51
|
end
|
52
|
+
rescue OpenSSL::SSL::SSLError
|
53
|
+
self.connection = false
|
54
|
+
puts "It looks like your SSL certificates aren't quite right."
|
55
|
+
puts "Please run `rvm osx-ssl-certs update all` and then try again."
|
56
|
+
exit
|
52
57
|
end
|
53
58
|
end
|
54
59
|
|
@@ -37,14 +37,14 @@ module Learn
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def sanitize!
|
40
|
-
|
40
|
+
sanitize_non_test_args!
|
41
41
|
sanitize_test_args!
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
45
45
|
|
46
46
|
# Sanitization methods
|
47
|
-
def
|
47
|
+
def sanitize_non_test_args!
|
48
48
|
args.map! do |arg|
|
49
49
|
SANITIZE_LIST[arg] ? SANITIZE_LIST[arg] : arg
|
50
50
|
end
|
@@ -62,7 +62,7 @@ module Learn
|
|
62
62
|
|
63
63
|
# Arg manipulation methods
|
64
64
|
def handle_missing_or_unknown_args
|
65
|
-
if
|
65
|
+
if first_arg_not_a_flag_or_file?
|
66
66
|
exit_with_unknown_command
|
67
67
|
elsif has_output_flag?
|
68
68
|
check_for_output_file
|
@@ -110,8 +110,16 @@ module Learn
|
|
110
110
|
args.empty? || !KNOWN_COMMANDS.include?(args[0])
|
111
111
|
end
|
112
112
|
|
113
|
-
def
|
114
|
-
args[0] && !args[0].start_with?('-')
|
113
|
+
def first_arg_not_a_flag_or_file?
|
114
|
+
args[0] && !args[0].start_with?('-') && first_arg_not_a_file?
|
115
|
+
end
|
116
|
+
|
117
|
+
def first_arg_not_a_file?
|
118
|
+
['/', '.'].none? { |punct| args[0].include?(punct) } && !File.exists?(args[0])
|
119
|
+
end
|
120
|
+
|
121
|
+
def arg_is_a_file?(arg)
|
122
|
+
arg && (['/', '.'].any? { |punct| arg.include?(punct) } || File.exists?(arg))
|
115
123
|
end
|
116
124
|
|
117
125
|
def has_output_flag?
|
@@ -119,6 +127,10 @@ module Learn
|
|
119
127
|
end
|
120
128
|
|
121
129
|
def only_has_known_test_flags?(start_index)
|
130
|
+
if arg_is_a_file?(args[start_index])
|
131
|
+
start_index += 1
|
132
|
+
end
|
133
|
+
|
122
134
|
args[start_index..-1].all? {|arg| KNOWN_TEST_FLAGS.include?(arg)}
|
123
135
|
end
|
124
136
|
|
@@ -127,11 +139,15 @@ module Learn
|
|
127
139
|
end
|
128
140
|
|
129
141
|
def only_has_flag_arguments?
|
130
|
-
|
142
|
+
if arg_is_a_file?(args[0])
|
143
|
+
args[1..-1].all? {|arg| arg.start_with?('-')}
|
144
|
+
else
|
145
|
+
args.all? {|arg| arg.start_with?('-')}
|
146
|
+
end
|
131
147
|
end
|
132
148
|
|
133
149
|
def has_test_command_and_invalid_flag?
|
134
|
-
args[0] == 'test' && args[1] && !args[1].start_with?('-')
|
150
|
+
args[0] == 'test' && args[1] && !args[1].start_with?('-') && !arg_is_a_file?(args[1])
|
135
151
|
end
|
136
152
|
|
137
153
|
def has_test_command_and_output_flag?
|
data/lib/learn/version.rb
CHANGED
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: learn-co
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flatiron School
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: learn-test
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.2.23
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.2.23
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: learn-config
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 1.0.73
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.0.73
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: learn-open
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.1.51
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.1.51
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: learn-submit
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 1.0.12
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 1.0.12
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: learn-doctor
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 1.0.2
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 1.0.2
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: learn-generate
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: 1.0.11
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 1.0.11
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: thor
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
description:
|
@@ -158,7 +158,7 @@ executables:
|
|
158
158
|
extensions: []
|
159
159
|
extra_rdoc_files: []
|
160
160
|
files:
|
161
|
-
-
|
161
|
+
- .gitignore
|
162
162
|
- Gemfile
|
163
163
|
- LICENSE.txt
|
164
164
|
- README.md
|
@@ -182,17 +182,17 @@ require_paths:
|
|
182
182
|
- bin
|
183
183
|
required_ruby_version: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- -
|
185
|
+
- - '>='
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
189
|
requirements:
|
190
|
-
- -
|
190
|
+
- - '>='
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
195
|
+
rubygems_version: 2.0.14
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: The command line interface to Learn.co.
|