learn-co 1.0.4 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/LICENSE.txt +0 -1
  4. data/README.md +4 -5
  5. data/Rakefile +0 -1
  6. data/bin/learn +11 -69
  7. data/learn-co.gemspec +10 -11
  8. data/lib/learn.rb +4 -21
  9. data/lib/learn/cli.rb +78 -0
  10. data/lib/learn/lab/parser.rb +25 -0
  11. data/lib/learn/options_sanitizer.rb +164 -0
  12. data/lib/learn/version.rb +1 -1
  13. metadata +30 -97
  14. data/.rspec +0 -2
  15. data/lib/learn/file_finder.rb +0 -12
  16. data/lib/learn/github_interactor.rb +0 -23
  17. data/lib/learn/jasmine/boot.js +0 -184
  18. data/lib/learn/jasmine/console.js +0 -161
  19. data/lib/learn/jasmine/formatters/jasmine2-junit.js +0 -199
  20. data/lib/learn/jasmine/helpers/ConsoleHelper.js +0 -12
  21. data/lib/learn/jasmine/helpers/ConsoleHelperNoColor.js +0 -12
  22. data/lib/learn/jasmine/initializer.rb +0 -27
  23. data/lib/learn/jasmine/jasmine-html.js +0 -360
  24. data/lib/learn/jasmine/jasmine-jquery.js +0 -813
  25. data/lib/learn/jasmine/jasmine.css +0 -56
  26. data/lib/learn/jasmine/jasmine.js +0 -2403
  27. data/lib/learn/jasmine/jasmine_favicon.png +0 -0
  28. data/lib/learn/jasmine/jquery-1.8.0.min.js +0 -2
  29. data/lib/learn/jasmine/jquery-ui-1.8.23.custom.min.js +0 -125
  30. data/lib/learn/jasmine/phantom_checker.rb +0 -55
  31. data/lib/learn/jasmine/runner.rb +0 -129
  32. data/lib/learn/jasmine/runners/SpecRunner.html +0 -35
  33. data/lib/learn/jasmine/runners/run-jasmine.js +0 -228
  34. data/lib/learn/jasmine/templates/SpecRunnerTemplate.html.erb +0 -35
  35. data/lib/learn/jasmine/templates/SpecRunnerTemplateNoColor.html.erb +0 -35
  36. data/lib/learn/jasmine/templates/requires.yml.example +0 -7
  37. data/lib/learn/jasmine/vendor/require.js +0 -2077
  38. data/lib/learn/netrc_interactor.rb +0 -18
  39. data/lib/learn/python_unittest/nose_installer.rb +0 -35
  40. data/lib/learn/python_unittest/requirements_checker.rb +0 -57
  41. data/lib/learn/python_unittest/runner.rb +0 -89
  42. data/lib/learn/repo_parser.rb +0 -22
  43. data/lib/learn/rspec/runner.rb +0 -113
  44. data/lib/learn/spec_type_parser.rb +0 -26
  45. data/lib/learn/user_id_parser.rb +0 -9
  46. data/lib/learn/username_parser.rb +0 -19
  47. data/spec/features/jasmine_jquery_fixtures_spec.rb +0 -10
  48. data/spec/features/rspec_unit_spec.rb +0 -10
  49. data/spec/fixtures/jasmine-jquery-fixtures/index.html +0 -10
  50. data/spec/fixtures/jasmine-jquery-fixtures/requires.yml +0 -4
  51. data/spec/fixtures/jasmine-jquery-fixtures/spec/jasmine-jquery-fixtures-spec.js +0 -11
  52. data/spec/fixtures/rspec-unit-spec/.rspec +0 -2
  53. data/spec/fixtures/rspec-unit-spec/lib/dog.rb +0 -2
  54. data/spec/fixtures/rspec-unit-spec/spec/dog_spec.rb +0 -7
  55. data/spec/fixtures/rspec-unit-spec/spec/spec_helper.rb +0 -93
  56. data/spec/repo_parser_spec.rb +0 -25
  57. data/spec/spec_helper.rb +0 -10
@@ -1,3 +1,3 @@
1
1
  module Learn
2
- VERSION = "1.0.4"
2
+ VERSION = '2.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learn-co
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.1.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-05-14 00:00:00.000000000 Z
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -39,27 +39,13 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: netrc
42
+ name: pry
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - ">="
60
46
  - !ruby/object:Gem::Version
61
47
  version: '0'
62
- type: :runtime
48
+ type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
@@ -67,63 +53,63 @@ dependencies:
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
- name: git
56
+ name: learn-test
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - "~>"
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
- version: '1.2'
61
+ version: 1.2.2
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - "~>"
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
- version: '1.2'
68
+ version: 1.2.2
83
69
  - !ruby/object:Gem::Dependency
84
- name: oj
70
+ name: learn-config
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - "~>"
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
- version: '2.9'
75
+ version: 1.0.5
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - "~>"
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: '2.9'
82
+ version: 1.0.5
97
83
  - !ruby/object:Gem::Dependency
98
- name: faraday
84
+ name: learn-open
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - "~>"
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
- version: '0.9'
89
+ version: 1.1.2
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - "~>"
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
- version: '0.9'
96
+ version: 1.1.2
111
97
  - !ruby/object:Gem::Dependency
112
- name: crack
98
+ name: learn-submit
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - ">="
116
102
  - !ruby/object:Gem::Version
117
- version: '0'
103
+ version: 1.0.9
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - ">="
123
109
  - !ruby/object:Gem::Version
124
- version: '0'
110
+ version: 1.0.9
125
111
  - !ruby/object:Gem::Dependency
126
- name: jasmine
112
+ name: thor
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
115
  - - ">="
@@ -138,14 +124,13 @@ dependencies:
138
124
  version: '0'
139
125
  description:
140
126
  email:
141
- - info@flatironschool.com
127
+ - learn@flatironschool.com
142
128
  executables:
143
129
  - learn
144
130
  extensions: []
145
131
  extra_rdoc_files: []
146
132
  files:
147
133
  - ".gitignore"
148
- - ".rspec"
149
134
  - Gemfile
150
135
  - LICENSE.txt
151
136
  - README.md
@@ -153,51 +138,11 @@ files:
153
138
  - bin/learn
154
139
  - learn-co.gemspec
155
140
  - lib/learn.rb
156
- - lib/learn/file_finder.rb
157
- - lib/learn/github_interactor.rb
158
- - lib/learn/jasmine/boot.js
159
- - lib/learn/jasmine/console.js
160
- - lib/learn/jasmine/formatters/jasmine2-junit.js
161
- - lib/learn/jasmine/helpers/ConsoleHelper.js
162
- - lib/learn/jasmine/helpers/ConsoleHelperNoColor.js
163
- - lib/learn/jasmine/initializer.rb
164
- - lib/learn/jasmine/jasmine-html.js
165
- - lib/learn/jasmine/jasmine-jquery.js
166
- - lib/learn/jasmine/jasmine.css
167
- - lib/learn/jasmine/jasmine.js
168
- - lib/learn/jasmine/jasmine_favicon.png
169
- - lib/learn/jasmine/jquery-1.8.0.min.js
170
- - lib/learn/jasmine/jquery-ui-1.8.23.custom.min.js
171
- - lib/learn/jasmine/phantom_checker.rb
172
- - lib/learn/jasmine/runner.rb
173
- - lib/learn/jasmine/runners/SpecRunner.html
174
- - lib/learn/jasmine/runners/run-jasmine.js
175
- - lib/learn/jasmine/templates/SpecRunnerTemplate.html.erb
176
- - lib/learn/jasmine/templates/SpecRunnerTemplateNoColor.html.erb
177
- - lib/learn/jasmine/templates/requires.yml.example
178
- - lib/learn/jasmine/vendor/require.js
179
- - lib/learn/netrc_interactor.rb
180
- - lib/learn/python_unittest/nose_installer.rb
181
- - lib/learn/python_unittest/requirements_checker.rb
182
- - lib/learn/python_unittest/runner.rb
183
- - lib/learn/repo_parser.rb
184
- - lib/learn/rspec/runner.rb
185
- - lib/learn/spec_type_parser.rb
186
- - lib/learn/user_id_parser.rb
187
- - lib/learn/username_parser.rb
141
+ - lib/learn/cli.rb
142
+ - lib/learn/lab/parser.rb
143
+ - lib/learn/options_sanitizer.rb
188
144
  - lib/learn/version.rb
189
- - spec/features/jasmine_jquery_fixtures_spec.rb
190
- - spec/features/rspec_unit_spec.rb
191
- - spec/fixtures/jasmine-jquery-fixtures/index.html
192
- - spec/fixtures/jasmine-jquery-fixtures/requires.yml
193
- - spec/fixtures/jasmine-jquery-fixtures/spec/jasmine-jquery-fixtures-spec.js
194
- - spec/fixtures/rspec-unit-spec/.rspec
195
- - spec/fixtures/rspec-unit-spec/lib/dog.rb
196
- - spec/fixtures/rspec-unit-spec/spec/dog_spec.rb
197
- - spec/fixtures/rspec-unit-spec/spec/spec_helper.rb
198
- - spec/repo_parser_spec.rb
199
- - spec/spec_helper.rb
200
- homepage: http://learn.co
145
+ homepage: https://learn.co
201
146
  licenses:
202
147
  - MIT
203
148
  metadata: {}
@@ -221,17 +166,5 @@ rubyforge_project:
221
166
  rubygems_version: 2.4.5
222
167
  signing_key:
223
168
  specification_version: 4
224
- summary: Runs RSpec, Jasmine, and Python Unit Test builds and pushes JSON output to
225
- Learn.
226
- test_files:
227
- - spec/features/jasmine_jquery_fixtures_spec.rb
228
- - spec/features/rspec_unit_spec.rb
229
- - spec/fixtures/jasmine-jquery-fixtures/index.html
230
- - spec/fixtures/jasmine-jquery-fixtures/requires.yml
231
- - spec/fixtures/jasmine-jquery-fixtures/spec/jasmine-jquery-fixtures-spec.js
232
- - spec/fixtures/rspec-unit-spec/.rspec
233
- - spec/fixtures/rspec-unit-spec/lib/dog.rb
234
- - spec/fixtures/rspec-unit-spec/spec/dog_spec.rb
235
- - spec/fixtures/rspec-unit-spec/spec/spec_helper.rb
236
- - spec/repo_parser_spec.rb
237
- - spec/spec_helper.rb
169
+ summary: The command line interface to Learn.co.
170
+ test_files: []
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
@@ -1,12 +0,0 @@
1
- module Learn
2
- class FileFinder
3
- def self.location_to_dir(dir_name)
4
- new.location_to_dir(dir_name)
5
- end
6
-
7
- def location_to_dir(dir_name)
8
- File.join(File.dirname(File.expand_path(__FILE__)), "#{dir_name}")
9
- end
10
- end
11
- end
12
-
@@ -1,23 +0,0 @@
1
- require 'open-uri'
2
-
3
- module Learn
4
- class GithubInteractor
5
- attr_reader :username, :user_id
6
-
7
- def self.get_user_id_for(username)
8
- new(username).get_user_id
9
- end
10
-
11
- def initialize(username)
12
- @username = username
13
- end
14
-
15
- def get_user_id
16
- @user_id ||= Oj.load(
17
- open("https://api.github.com/users/#{username}").read,
18
- symbol_keys: true
19
- )[:id]
20
- end
21
- end
22
- end
23
-
@@ -1,184 +0,0 @@
1
- /**
2
- Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
3
-
4
- If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
5
-
6
- The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
7
-
8
- [jasmine-gem]: http://github.com/pivotal/jasmine-gem
9
- */
10
-
11
- (function() {
12
-
13
- /**
14
- * ## Require & Instantiate
15
- *
16
- * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
17
- */
18
- window.jasmine = jasmineRequire.core(jasmineRequire);
19
-
20
- /**
21
- * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
22
- */
23
- jasmineRequire.html(jasmine);
24
-
25
- /**
26
- * Create the Jasmine environment. This is used to run all specs in a project.
27
- */
28
- var env = jasmine.getEnv();
29
-
30
- /**
31
- * ## The Global Interface
32
- *
33
- * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
34
- */
35
- var jasmineInterface = {
36
- describe: function(description, specDefinitions) {
37
- return env.describe(description, specDefinitions);
38
- },
39
-
40
- xdescribe: function(description, specDefinitions) {
41
- return env.xdescribe(description, specDefinitions);
42
- },
43
-
44
- it: function(desc, func) {
45
- return env.it(desc, func);
46
- },
47
-
48
- xit: function(desc, func) {
49
- return env.xit(desc, func);
50
- },
51
-
52
- beforeEach: function(beforeEachFunction) {
53
- return env.beforeEach(beforeEachFunction);
54
- },
55
-
56
- afterEach: function(afterEachFunction) {
57
- return env.afterEach(afterEachFunction);
58
- },
59
-
60
- expect: function(actual) {
61
- return env.expect(actual);
62
- },
63
-
64
- pending: function() {
65
- return env.pending();
66
- },
67
-
68
- spyOn: function(obj, methodName) {
69
- return env.spyOn(obj, methodName);
70
- },
71
-
72
- jsApiReporter: new jasmine.JsApiReporter({
73
- timer: new jasmine.Timer()
74
- })
75
- };
76
-
77
- /**
78
- * Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
79
- */
80
- if (typeof window == "undefined" && typeof exports == "object") {
81
- extend(exports, jasmineInterface);
82
- } else {
83
- extend(window, jasmineInterface);
84
- }
85
-
86
- /**
87
- * Expose the interface for adding custom equality testers.
88
- */
89
- jasmine.addCustomEqualityTester = function(tester) {
90
- env.addCustomEqualityTester(tester);
91
- };
92
-
93
- /**
94
- * Expose the interface for adding custom expectation matchers
95
- */
96
- jasmine.addMatchers = function(matchers) {
97
- return env.addMatchers(matchers);
98
- };
99
-
100
- /**
101
- * Expose the mock interface for the JavaScript timeout functions
102
- */
103
- jasmine.clock = function() {
104
- return env.clock;
105
- };
106
-
107
- /**
108
- * ## Runner Parameters
109
- *
110
- * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
111
- */
112
-
113
- var queryString = new jasmine.QueryString({
114
- getWindowLocation: function() { return window.location; }
115
- });
116
-
117
- var catchingExceptions = queryString.getParam("catch");
118
- env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
119
-
120
- /**
121
- * ## Reporters
122
- * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
123
- */
124
- var htmlReporter = new jasmine.HtmlReporter({
125
- env: env,
126
- onRaiseExceptionsClick: function() { queryString.setParam("catch", !env.catchingExceptions()); },
127
- getContainer: function() { return document.body; },
128
- createElement: function() { return document.createElement.apply(document, arguments); },
129
- createTextNode: function() { return document.createTextNode.apply(document, arguments); },
130
- timer: new jasmine.Timer()
131
- });
132
-
133
- /**
134
- * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
135
- */
136
- env.addReporter(jasmineInterface.jsApiReporter);
137
- var JUnitXmlReporter = jasmineRequire.JUnitXmlReporter()
138
- env.addReporter(new JUnitXmlReporter());
139
- env.addReporter(htmlReporter);
140
-
141
- /**
142
- * Filter which specs will be run by matching the start of the full name against the `spec` query param.
143
- */
144
- var specFilter = new jasmine.HtmlSpecFilter({
145
- filterString: function() { return queryString.getParam("spec"); }
146
- });
147
-
148
- env.specFilter = function(spec) {
149
- return specFilter.matches(spec.getFullName());
150
- };
151
-
152
- /**
153
- * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
154
- */
155
- window.setTimeout = window.setTimeout;
156
- window.setInterval = window.setInterval;
157
- window.clearTimeout = window.clearTimeout;
158
- window.clearInterval = window.clearInterval;
159
-
160
- /**
161
- * ## Execution
162
- *
163
- * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
164
- */
165
- var currentWindowOnload = window.onload;
166
-
167
- window.onload = function() {
168
- if (currentWindowOnload) {
169
- currentWindowOnload();
170
- }
171
- htmlReporter.initialize();
172
- env.execute();
173
- };
174
-
175
- /**
176
- * Helper function for readability above.
177
- */
178
- function extend(destination, source) {
179
- for (var property in source) destination[property] = source[property];
180
- return destination;
181
- }
182
-
183
- }());
184
-