quik_start 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in quik_start.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Scott Ballantyne
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # QuikStart
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'quik_start'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install quik_start
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
data/bin/qs ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'fileutils'
5
+ require 'quik_start'
6
+
7
+ $to_install = []
8
+ $assets = {}
9
+ $platform = :rails
10
+
11
+ OptionParser.new do |opts|
12
+ opts.banner = "Usage: --library_name"
13
+ opts.on("--rails", "Use rails as a target") { $platform = :rails }
14
+ # opts.on("--django") { $platform = :django }
15
+ opts.on("--bootstrap") { $to_install << :bootstrap }
16
+ opts.on("--jquery") { $to_install << :jquery }
17
+ opts.on("--jqueryui") { $to_install << :jqueryui }
18
+ opts.on("--angular") { $to_install << :angular }
19
+ opts.on("--backbone") { $to_install << :backbone }
20
+
21
+ opts.on("--d3") { $to_install << :d3 }
22
+ opts.on("-h", "--help", "Print Help") do
23
+ puts opts
24
+ exit 0
25
+ end
26
+
27
+ begin
28
+ opts.parse!(ARGV)
29
+ rescue OptionParser::ParseError => e
30
+ warn e.message
31
+ puts opts
32
+ exit 1
33
+ end
34
+ end
35
+ $start_time = Time.now
36
+
37
+ $to_install.each do |lib_name|
38
+ if $assets[lib_name] == nil
39
+ QuikStart.install(lib_name).each do |installed|
40
+ $assets[installed] = true
41
+ end
42
+ end
43
+ end
44
+
45
+ QuikStart.download_all($assets)
46
+ QuikStart.log_duration($start_time)
@@ -0,0 +1,3 @@
1
+ module QuikStart
2
+ VERSION = "0.0.2"
3
+ end
data/lib/quik_start.rb ADDED
@@ -0,0 +1,167 @@
1
+ require "quik_start/version"
2
+ require 'curb'
3
+ require 'pinch'
4
+ require 'zip/zip'
5
+
6
+ module QuikStart
7
+
8
+ def self.install(lib_name)
9
+ check_listing(lib_name)
10
+ check_dependencies(lib_name)
11
+ resolve(lib_name)
12
+ @installed
13
+ end
14
+
15
+ def self.check_listing(lib_name)
16
+ puts "--> "+lib_name.to_s + " not in QuikStart" if libraries[lib_name].nil?
17
+ end
18
+
19
+ def self.check_dependencies(lib_name)
20
+ if libraries[lib_name] != nil && libraries[lib_name][:dependencies]
21
+ libraries[lib_name][:dependencies].each do |d|
22
+ install(d)
23
+ end
24
+ end
25
+ end
26
+
27
+ def self.resolve(lib_name)
28
+ @installed = [] if @installed == nil
29
+ @installed << lib_name
30
+ puts 'resolving ' + lib_name.to_s unless libraries[lib_name].nil?
31
+ end
32
+
33
+ def self.log_duration(start_time)
34
+ duration = Time.now - start_time
35
+ puts duration.to_s + ' seconds'
36
+ end
37
+
38
+ def self.download_all(libs)
39
+ puts 'downloading...'
40
+ to_install = []
41
+ libs.keys.each do |l|
42
+ lib = QuikStart.libraries[l][:development]
43
+ to_install << lib if lib != nil
44
+ end
45
+
46
+ libs.keys.each do |l|
47
+ lib = QuikStart.libraries[l][:package]
48
+ to_install << lib if lib != nil
49
+ end
50
+
51
+ responses = {}
52
+ requests = to_install.uniq
53
+ m = Curl::Multi.new
54
+ requests.each do |url|
55
+ responses[url] = ""
56
+ c = Curl::Easy.new(url) do|curl|
57
+ curl.follow_location = true
58
+ curl.on_body{|data| responses[url] << data; data.size }
59
+ curl.on_success {|easy| }
60
+ end
61
+ m.add(c)
62
+ end
63
+
64
+ m.perform do
65
+ # puts "idling... can do some work here"
66
+ end
67
+
68
+
69
+ libs.keys.each do |l|
70
+ url = QuikStart.libraries[l][:target]
71
+ if QuikStart.libraries[l][:development]
72
+ File.open(File.expand_path('.')+url, 'w') do |f2|
73
+ f2.puts responses[QuikStart.libraries[l][:development]]
74
+ end
75
+ else
76
+ File.open(File.expand_path('.')+url, 'w') do |f2|
77
+ f2.puts responses[QuikStart.libraries[l][:package]]
78
+ end
79
+ unzip(File.expand_path('.')+url)
80
+ end
81
+ end
82
+
83
+ write_asset_files
84
+ end
85
+
86
+ def self.unzip(file)
87
+ Zip::ZipFile.open(file) do |zipfile|
88
+ zipfile.each do |entry|
89
+ if File.extname(entry.name) == '.js'
90
+ File.open(File.expand_path('.')+'/app/assets/javascripts/'+File.basename(entry.name), 'w') do |f2|
91
+ f2.puts entry.get_input_stream.read
92
+ end
93
+ end
94
+ if File.extname(entry.name) == '.css'
95
+ File.open(File.expand_path('.')+'/app/assets/stylesheets/'+File.basename(entry.name), 'w') do |f2|
96
+ f2.puts entry.get_input_stream.read
97
+ end
98
+ end
99
+ end
100
+ end
101
+ File.delete(file)
102
+ end
103
+
104
+ def self.write_asset_files
105
+ write_css_file
106
+ write_js_file
107
+ end
108
+
109
+ def self.write_css_file
110
+ puts 'writing application.css'
111
+ end
112
+
113
+ def self.write_js_file
114
+ puts 'writing application.js'
115
+ end
116
+
117
+ def self.extract_bootstrap
118
+
119
+ end
120
+
121
+ def self.libraries
122
+ {
123
+ :backbone => {
124
+ :development => 'http://backbonejs.org/backbone.js',
125
+ :production => 'http://backbonejs.org/backbone-min.js',
126
+ :dependencies => [:underscore, :json2],
127
+ :target => '/app/assets/javascripts/backbone.js'
128
+ },
129
+ :bootstrap => {
130
+ :package => 'http://twitter.github.com/bootstrap/assets/bootstrap.zip',
131
+ :dependencies => [:jquery],
132
+ :extraction_method => :extract_bootstrap,
133
+ :target => '/app/assets/javascripts/bootstrap.zip'
134
+ },
135
+ :underscore => {
136
+ :development => 'http://underscorejs.org/underscore.js',
137
+ :production => 'http://underscorejs.org/underscore-min.js',
138
+ :target => '/app/assets/javascripts/underscore.js'
139
+ },
140
+ :json2 => {
141
+ :development => 'https://raw.github.com/douglascrockford/JSON-js/master/json2.js',
142
+ :production => 'https://raw.github.com/douglascrockford/JSON-js/master/json2.js',
143
+ :target => '/app/assets/javascripts/json2.js'
144
+ },
145
+ :jqueryui => {
146
+ :production => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js',
147
+ :development => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.js',
148
+ :target => '/app/assets/javascripts/jquery-ui.js'
149
+ },
150
+ :jquery => {
151
+ :production => 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
152
+ :development => 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js',
153
+ :target => '/app/assets/javascripts/jquery.js'
154
+ },
155
+ :angular => {
156
+ :development => 'https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js',
157
+ :production => 'https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js',
158
+ :target => '/app/assets/javascripts/angular.js'
159
+ },
160
+ :d3 => {
161
+ :development => 'https://raw.github.com/mbostock/d3/master/d3.min.js',
162
+ :production => 'https://raw.github.com/mbostock/d3/master/d3.js',
163
+ :target => '/app/assets/javascripts/d3.js'
164
+ }
165
+ }
166
+ end
167
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'quik_start/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "quik_start"
8
+ gem.version = QuikStart::VERSION
9
+ gem.authors = ["Scott Ballantyne"]
10
+ gem.email = ["ussballantyne@gmail.com"]
11
+ gem.executables << 'qs'
12
+ gem.description = %q{gem for setting up projects}
13
+ gem.summary = %q{gem for setting up projects}
14
+ gem.homepage = ""
15
+ gem.signing_key = '/Users/scott/gem-private_key.pem'
16
+ gem.cert_chain = ['/Users/scott/gem-public_cert.pem']
17
+ gem.files = `git ls-files`.split($/)
18
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
19
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
+ gem.require_paths = ["lib"]
21
+ gem.add_dependency('curb')
22
+ gem.add_dependency('rubyzip')
23
+ gem.add_dependency('pinch')
24
+ end
data.tar.gz.sig ADDED
@@ -0,0 +1,5 @@
1
+ ���Ǫª䎛fJBJ@�[�
2
+ �6
3
+ �G���6����ض(E�4i���O��'�GD�u�(vO�3ʒ�3:�ɯ|!�
4
+ ��R�Y�C#ܝ�N���;�+I~�Qm���(_��D媮�۽�{T�/�����$G��Y�T�@
5
+ Ai�NI Zy�l�|s\�ru�v�m�<&g
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: quik_start
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Scott Ballantyne
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain:
12
+ - !binary |-
13
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURQRENDQWlTZ0F3SUJB
14
+ Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREJFTVJZd0ZBWURWUVFEREExMWMz
15
+ TmkKWVd4c1lXNTBlVzVsTVJVd0V3WUtDWkltaVpQeUxHUUJHUllGWjIxaGFX
16
+ d3hFekFSQmdvSmtpYUprL0lzWkFFWgpGZ05qYjIwd0hoY05NVE13TXpFME1E
17
+ VXhOVFEyV2hjTk1UUXdNekUwTURVeE5UUTJXakJFTVJZd0ZBWURWUVFECkRB
18
+ MTFjM05pWVd4c1lXNTBlVzVsTVJVd0V3WUtDWkltaVpQeUxHUUJHUllGWjIx
19
+ aGFXd3hFekFSQmdvSmtpYUoKay9Jc1pBRVpGZ05qYjIwd2dnRWlNQTBHQ1Nx
20
+ R1NJYjNEUUVCQVFVQUE0SUJEd0F3Z2dFS0FvSUJBUUQyQXVKSgpodmFndVN6
21
+ NHN5VEsvamhZZW50R3lZWlNQSmxQYzJnYy9kNktjSllENTRRRnFUMlIzaHNz
22
+ NXJyOWVZZktxejNTClcyeThiVlRSS3dpWTNTMysrT3pCL2N5cnNRT3BuRmhr
23
+ Zmtjcnc5TGVhNkFMeW43OWdhd1JSdmk1bTdDQjRoQ2MKQmkzTWhjYThsaEpD
24
+ VFJGOGtBNzNsK1lIblFsNURzdXNVeGw1S3ZCSjFlKzZidzJtclBYejQvT3Rl
25
+ OXQvd1RpUwp0SDI4NFJISUE4VUF6S3B6dk5wMEZWalUvNHg1emVZSDZ0c05E
26
+ WEVJekdCT0drL2VSTmpBQk8wVXBDYWxFelI0CkxINmVVZFNFSFBjdVVLODFO
27
+ LzhIeklMZEdSM3QrTWhhQXlYYzZBY2hvd3NwZWZmUDhaUnRFK2FqZ1hjMDRo
28
+ TTcKSmlnQmJ0UjJDMHdEeU12eEFnTUJBQUdqT1RBM01Ba0dBMVVkRXdRQ01B
29
+ QXdIUVlEVlIwT0JCWUVGSTNtS2VxYwo0dHNib0VLeHdyMC9mblFTYTN6dU1B
30
+ c0dBMVVkRHdRRUF3SUVzREFOQmdrcWhraUc5dzBCQVFVRkFBT0NBUUVBCm5h
31
+ UFU4MkFrRE1xc093WmpLM3JLdG5tMjNYaHVBV05BLzZHTXNLSzJiS01odlBV
32
+ a0JPLys5ZzJ6UUVkbHlkTnIKWSt0bzNPNDJUaFdYUkpBRHhtbmRFTE9oQ1lI
33
+ UWtDQzdxeU9QdzVrWElGZ2xiYWlnOCt0QmlNVW9mNzcxZVhMRQp6cVlZeHZa
34
+ R2NDV0plQlRUZzZZdEJaM2F4cjB1R3kycmtJT2pQNUxCRy81SVA4SGJQSnY4
35
+ MG1rcCtDK2tzMGErCmxFM0JsSFIyM01MVllzTnpoV0xOZDF1SVdFN3VKTXBk
36
+ bXNhaTF4VjBlTHIvR3l3UHNuaXhxTU1vQXdNQnFTYlcKdHFDa2kvYVlEQW9K
37
+ N2xDUGFqVEpXOE1mMXQ3VU5BUk5QYVpOdzZaS3pTYS9VMFZQTG5rOEJET1Ix
38
+ cHUzenhMdwo4Y0szM3FyNWtFYXlVOWE3dnVCMUdRPT0KLS0tLS1FTkQgQ0VS
39
+ VElGSUNBVEUtLS0tLQo=
40
+ date: 2013-03-14 00:00:00.000000000 Z
41
+ dependencies:
42
+ - !ruby/object:Gem::Dependency
43
+ name: curb
44
+ requirement: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ - !ruby/object:Gem::Dependency
59
+ name: rubyzip
60
+ requirement: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ - !ruby/object:Gem::Dependency
75
+ name: pinch
76
+ requirement: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ description: gem for setting up projects
91
+ email:
92
+ - ussballantyne@gmail.com
93
+ executables:
94
+ - application.default.css
95
+ - application.default.js
96
+ - qs
97
+ extensions: []
98
+ extra_rdoc_files: []
99
+ files:
100
+ - .gitignore
101
+ - Gemfile
102
+ - LICENSE.txt
103
+ - README.md
104
+ - Rakefile
105
+ - bin/application.default.css
106
+ - bin/application.default.js
107
+ - bin/qs
108
+ - lib/quik_start.rb
109
+ - lib/quik_start/version.rb
110
+ - quik_start.gemspec
111
+ homepage: ''
112
+ licenses: []
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ! '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ requirements: []
130
+ rubyforge_project:
131
+ rubygems_version: 1.8.25
132
+ signing_key:
133
+ specification_version: 3
134
+ summary: gem for setting up projects
135
+ test_files: []
metadata.gz.sig ADDED
Binary file