new 0.0.0 → 0.0.1

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. metadata +7 -66
  3. data/.gitignore +0 -7
  4. data/.rspec +0 -2
  5. data/Gemfile +0 -16
  6. data/Gemfile.lock +0 -79
  7. data/Guardfile +0 -14
  8. data/LICENSE.txt +0 -22
  9. data/README.md +0 -121
  10. data/bin/new +0 -6
  11. data/lib/new/cli.rb +0 -94
  12. data/lib/new/core.rb +0 -6
  13. data/lib/new/dsl.rb +0 -42
  14. data/lib/new/interpolate.rb +0 -100
  15. data/lib/new/project.rb +0 -34
  16. data/lib/new/task.rb +0 -41
  17. data/lib/new/template.rb +0 -64
  18. data/lib/new/version.rb +0 -41
  19. data/lib/new.rb +0 -72
  20. data/spec/fixtures/custom/tasks/custom_bar_task/custom_bar_task.rb +0 -3
  21. data/spec/fixtures/custom/templates/custom_bar_template/custom_bar.txt +0 -0
  22. data/spec/fixtures/tasks/custom_bar_task/custom_bar_task.rb +0 -1
  23. data/spec/fixtures/tasks/foo_task/foo_task.rb +0 -7
  24. data/spec/fixtures/templates/foo_template/[FOO.BAR].txt.erb +0 -1
  25. data/spec/fixtures/templates/foo_template/nested_[FOO.BAR]/foo.txt.erb +0 -1
  26. data/spec/lib/new/cli_spec.rb +0 -104
  27. data/spec/lib/new/interpolate_spec.rb +0 -41
  28. data/spec/lib/new/project_spec.rb +0 -30
  29. data/spec/lib/new/task_spec.rb +0 -39
  30. data/spec/lib/new/template_spec.rb +0 -59
  31. data/spec/lib/new/version_spec.rb +0 -28
  32. data/spec/lib/new_spec.rb +0 -19
  33. data/spec/spec_helper.rb +0 -26
  34. data/tasks/gem/README.md +0 -36
  35. data/tasks/gem/gem.rb +0 -118
  36. data/templates/js/Gemfile +0 -30
  37. data/templates/js/Guardfile +0 -7
  38. data/templates/js/LICENSE-MIT.erb +0 -22
  39. data/templates/js/README.md.erb +0 -61
  40. data/templates/js/demo/index.html.erb +0 -7
  41. data/templates/js/lib/README.md +0 -2
  42. data/templates/js/spec/[PROJECT_NAME].spec.js.coffee.erb +0 -1
  43. data/templates/js/spec/index.html.erb +0 -29
  44. data/templates/js/spec/spec_helper.js.coffee +0 -0
  45. data/templates/js/spec/vendor/chai.js +0 -3765
  46. data/templates/js/spec/vendor/sinon-chai.js +0 -106
  47. data/templates/js/spec/vendor/sinon.js +0 -4246
  48. data/templates/js/src/README.md +0 -3
  49. data/templates/js/src/[PROJECT_NAME].js.coffee.erb +0 -10
  50. data/templates/js/testem.yml +0 -12
data/tasks/gem/gem.rb DELETED
@@ -1,118 +0,0 @@
1
- require 'rake'
2
- require 'yaml'
3
-
4
- class New::Task::Gem < New::Task
5
- include New::Interpolate
6
- include New::Version
7
-
8
- GLOB_ATTRIBUTES = [:files, :test_files, :extra_rdoc_files]
9
- OPTIONS = {
10
- gemspec: {
11
- summary: "A short summary of this gem's description. Displayed in `gem list -d`",
12
- files: ['**/*']
13
- }
14
- }
15
-
16
- def run
17
- @gemspec = options[:gemspec]
18
-
19
- validate_files
20
- render_gemspec_options
21
- set_version
22
- write_gemspec
23
- write_config
24
- deploy
25
- end
26
-
27
- def render_gemspec_options
28
- string = []
29
-
30
- # set defaults
31
- @gemspec[:date] = Date.today.to_s
32
- @gemspec[:name] = project_options[:project_name]
33
- @gemspec[:version] = project_options[:version]
34
- @gemspec[:author] ||= project_options[:developer][:name]
35
- @gemspec[:email] ||= project_options[:developer][:email]
36
- @gemspec[:license] ||= project_options[:license]
37
-
38
- # remove singular attributes if plural attribute is specified
39
- if @gemspec[:authors]
40
- @gemspec.delete(:author)
41
- @gemspec[:authors] = @gemspec[:authors]
42
- end
43
- if @gemspec[:licenses]
44
- @gemspec.delete(:license)
45
- @gemspec[:licenses] = @gemspec[:licenses]
46
- end
47
-
48
- @gemspec.sort.each do |k,v|
49
- val = case v
50
- when String then "'#{v}'"
51
- else v
52
- end
53
-
54
- string << " s.#{k} = #{val}"
55
- end
56
-
57
- project_options[:gemspec_string] = string.join("\n")
58
- end
59
-
60
- def validate_files
61
- GLOB_ATTRIBUTES.each do |file_attr|
62
- next if @gemspec[file_attr].nil?
63
-
64
- files = []
65
- @gemspec[file_attr].each do |glob|
66
- matching_files = FileList.new(glob).select{ |f| File.file? f }
67
-
68
- if matching_files.empty?
69
- New.say "The pattern `#{glob}` in `tasks.gem.gemspec.#{file_attr}` did not match any files."
70
- New.say 'Please check your configuration file.'
71
- exit
72
- else
73
- files << matching_files
74
- end
75
- end
76
-
77
- @gemspec[file_attr] = files.flatten
78
- end
79
- end
80
-
81
- def set_version
82
- # set version
83
- self.version = project_options[:version]
84
-
85
- # bump version
86
- bump_version get_part
87
-
88
- # set new version to config
89
- project_options[:version] = version.to_s
90
- end
91
-
92
- def write_gemspec
93
- # process gemspec
94
- interpolate File.join(File.dirname(__FILE__), '.gemspec.erb'), project_options
95
-
96
- # copy it to the project
97
- FileUtils.cp File.join(@dest_path, '.gemspec'), Dir.pwd
98
-
99
- # cleanup the tmp
100
- FileUtils.rm_rf @dest_path
101
- end
102
-
103
- def write_config
104
- writeable_options = project_options.dup
105
- writeable_options.delete(:gemspec_string)
106
- GLOB_ATTRIBUTES.each{ |a| writeable_options.delete(a) }
107
-
108
- File.open(New::CONFIG_FILE, 'w+') do |f|
109
- f.write writeable_options.deep_stringify_keys.to_yaml
110
- end
111
- end
112
-
113
- def deploy
114
- `gem update --system`
115
- `gem build .gemspec`
116
- `gem push #{@gemspec[:name]}-#{@gemspec[:version]}.gem`
117
- end
118
- end
data/templates/js/Gemfile DELETED
@@ -1,30 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'bundler', '>= 1.2.0'
4
-
5
- group :development do
6
- gem 'guard'
7
- gem 'guard-coffeescript'
8
- gem 'guard-sass'
9
- end
10
-
11
- # Platform specific gems (set `require: false`)
12
- group :development do
13
- gem 'rb-fsevent', :require => false
14
- gem 'growl', require: false
15
- gem 'terminal-notifier-guard', require: false
16
- end
17
-
18
- # OS X
19
- if RUBY_PLATFORM.downcase =~ /darwin/
20
- require 'rb-fsevent'
21
-
22
- # >= 10.8 Mountain Lion
23
- if RUBY_PLATFORM.downcase =~ /darwin12/
24
- require 'terminal-notifier-guard'
25
-
26
- # <= 10.7 Lion
27
- else
28
- require 'growl'
29
- end
30
- end
@@ -1,7 +0,0 @@
1
- # Source
2
- guard :coffeescript, input: 'src', output: 'lib', hide_success: true
3
- guard :sass, input: 'src', :noop => true
4
-
5
- # Tests
6
- guard :coffeescript, input: 'spec', output: '.tmp', hide_success: true
7
- guard :sass, input: 'spec', output: '.tmp', hide_success: true
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 <%= developer.name %> <%= project_name %>
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without
6
- restriction, including without limitation the rights to use,
7
- copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the
9
- Software is furnished to do so, subject to the following
10
- conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
@@ -1,61 +0,0 @@
1
- # <%= project_name %>
2
-
3
- ## Dependencies
4
- *
5
-
6
- _Optional_
7
-
8
- *
9
-
10
- ## Usage
11
-
12
- #### Methods
13
-
14
- ###### METHOD NAME
15
- _METHOD DESCRIPTION_
16
- > _Arguments_
17
- ```yaml
18
- argument: Argument description # default:
19
- ```
20
-
21
- ---
22
- > _example_
23
- ```coffee
24
- METHOD ARGUMENT
25
- ```
26
-
27
- ## Development
28
-
29
- ### Dependencies
30
- * Ruby
31
- * Bundler Gem
32
- * Node.js
33
- * npm
34
- * Testem
35
- * PhantomJS
36
-
37
- _Optional_
38
-
39
- * Growl _\* for <= OS X Lion 10.7_
40
-
41
- ### Compiling
42
- `bundle exec guard`
43
-
44
- Do **NOT** modify any `.js` files! Modify the coffee files in the `src` directory. Guard will watch for changes and compile them to the `lib` directory.
45
-
46
- ### Testing
47
- Run `testem`
48
-
49
- _- or -_
50
-
51
- Run `testem -g` if running OS X Lion or below for Growl support
52
-
53
- ## To-Do
54
- *
55
-
56
- ## Contributing
57
- 1. Fork it ( http://github.com/<%= tasks.github.username %>/<%= project_name %>/fork )
58
- 2. Create your feature branch (`git checkout -b my-new-feature`)
59
- 3. Commit your changes (`git commit -am 'Add some feature'`)
60
- 4. Push to the branch (`git push origin my-new-feature`)
61
- 5. Create new Pull Request
@@ -1,7 +0,0 @@
1
- <html>
2
- <head>
3
- <script src="../lib/<%= project_name %>.js"></script>
4
- </head>
5
- <body>
6
- </body>
7
- </html>
@@ -1,2 +0,0 @@
1
- # DO NOT MODIFY!
2
- #### Any modifications to the javascripts should be made on the CoffeeScript source files under `src` and compiled to generate these `.js` files.
@@ -1 +0,0 @@
1
- describe '<%= project_name %>', ->
@@ -1,29 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="/testem/mocha.css">
4
- <script src="/testem/mocha.js"></script>
5
- <script src="/testem.js"></script>
6
- <script src="/spec/vendor/chai.js"></script>
7
- <script src="/spec/vendor/sinon.js"></script>
8
- <script src="/spec/vendor/sinon-chai.js"></script>
9
- <script>
10
- mocha.setup('bdd');
11
- mocha.setup({ignoreLeaks: true});
12
- window.expect = chai.expect;
13
- </script>
14
-
15
- <!-- Scripts -->
16
- <script src="/lib/<%= project_name %>.js"></script>
17
-
18
- <!-- Specs -->
19
- <script src="/.tmp/spec_helper.js"></script>
20
- <script src="/.tmp/<%= project_name %>.spec.js"></script>
21
-
22
- </head>
23
- <body>
24
- <div id='mocha'></div>
25
- <script>
26
- mocha.run();
27
- </script>
28
- </body>
29
- </html>
File without changes