railsthemes 1.1.pre → 1.1.pre.2

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 (33) hide show
  1. data/Gemfile +2 -2
  2. data/bin/railsthemes +27 -12
  3. data/cacert.pem +3331 -0
  4. data/lib/railsthemes/email_installer.rb +73 -0
  5. data/lib/railsthemes/ensurer.rb +152 -0
  6. data/lib/railsthemes/installer.rb +116 -345
  7. data/lib/railsthemes/logging.rb +35 -0
  8. data/lib/railsthemes/theme_installer.rb +126 -0
  9. data/lib/railsthemes/utils.rb +116 -24
  10. data/lib/railsthemes/version.rb +1 -1
  11. data/lib/railsthemes.rb +22 -1
  12. data/railsthemes.gemspec +2 -0
  13. data/spec/fixtures/blank-assets/{base/app/assets/images/bg/sprite.png → email/app/assets/stylesheets/email.css} +0 -0
  14. data/spec/fixtures/blank-assets/{base/app/assets/images/image1.png → erb-css/base/app/assets/images/bg/sprite.png} +0 -0
  15. data/spec/fixtures/blank-assets/{base/app/assets/javascripts/jquery.dataTables.js → erb-css/base/app/assets/images/image1.png} +0 -0
  16. data/spec/fixtures/blank-assets/{base/app/assets/javascripts/scripts.js.erb → erb-css/base/app/assets/javascripts/jquery.dataTables.js} +0 -0
  17. data/spec/fixtures/blank-assets/{base/app/views/layouts/_interior_sidebar.html.erb → erb-css/base/app/assets/javascripts/scripts.js.erb} +0 -0
  18. data/spec/fixtures/blank-assets/{base → erb-css/base}/app/assets/stylesheets/style.css.erb +0 -0
  19. data/spec/fixtures/blank-assets/{base/app/views/layouts/application.html.erb → erb-css/base/app/views/layouts/_interior_sidebar.html.erb} +0 -0
  20. data/spec/fixtures/blank-assets/{base/app/views/layouts/homepage.html.erb → erb-css/base/app/views/layouts/application.html.erb} +0 -0
  21. data/spec/fixtures/blank-assets/{gems/formtastic/app/assets/stylesheets/formtastic.css.scss → erb-css/base/app/views/layouts/homepage.html.erb} +0 -0
  22. data/spec/fixtures/blank-assets/{gems/simple_form/app/assets/stylesheets/simple_form.css.scss → erb-css/gems/formtastic/app/assets/stylesheets/formtastic.css.scss} +0 -0
  23. data/spec/fixtures/blank-assets/erb-css/gems/simple_form/app/assets/stylesheets/simple_form.css.scss +0 -0
  24. data/spec/fixtures/{blank-assets.tar.gz → blank-assets-archived/email.tar.gz} +0 -0
  25. data/spec/fixtures/blank-assets-archived/erb-css.tar.gz +0 -0
  26. data/spec/lib/railsthemes/email_installer_spec.rb +8 -0
  27. data/spec/lib/railsthemes/ensurer_spec.rb +215 -0
  28. data/spec/lib/railsthemes/installer_spec.rb +100 -456
  29. data/spec/lib/railsthemes/theme_installer_spec.rb +206 -0
  30. data/spec/lib/railsthemes/utils_spec.rb +62 -0
  31. data/spec/spec_helper.rb +49 -0
  32. metadata +71 -26
  33. data/lib/railsthemes/win_cacerts.rb +0 -26
data/Gemfile CHANGED
@@ -1,10 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in railsthemes.gemspec
4
3
  gemspec
5
4
  gem 'thor'
6
5
  gem 'rest-client'
7
6
  gem 'launchy'
7
+ gem 'json'
8
+ # make sure you add any new dependencies in railsthemes.gemspec
8
9
 
9
10
  group :development do
10
11
  gem 'gem-release'
@@ -12,7 +13,6 @@ group :development do
12
13
  gem 'guard-rspec'
13
14
  end
14
15
 
15
- # development gems
16
16
  group :test do
17
17
  gem 'rspec'
18
18
  gem 'rr'
data/bin/railsthemes CHANGED
@@ -4,9 +4,27 @@ require "thor"
4
4
  require "railsthemes"
5
5
 
6
6
  class Installer < Thor
7
- desc "install CODE", "Install from RailsThemes.com using your download code"
7
+ desc "default", "The default task to run when no command is given"
8
+ method_option :version,
9
+ :desc => "See what version you have installed",
10
+ :aliases => ['-v', '--version'],
11
+ :type => :boolean
12
+ def default
13
+ if options[:version]
14
+ puts Railsthemes::VERSION
15
+ else
16
+ puts <<-EOS
17
+ railsthemes -v # Print the version of the installer gem you are using
18
+ railsthemes install your@email:code # Install from RailsThemes.com using your download code
19
+ railsthemes help [TASK] # Describe available tasks or one specific task
20
+ EOS
21
+ end
22
+ end
23
+ default_task :default
24
+
25
+ desc "install your@email:code", "Install from RailsThemes.com using your download code"
8
26
  method_option :file,
9
- :desc => "Use local filename instead of downloading.",
27
+ :desc => "Use local relative pathname instead of a code, and install from there.",
10
28
  :type => :boolean
11
29
  method_option :no_doc_popup,
12
30
  :desc => "Do not pop up documentation on successful install.",
@@ -18,31 +36,28 @@ class Installer < Thor
18
36
  method_option :debugging,
19
37
  :desc => "Print gratuitous output on installation (for debugging).",
20
38
  :type => :boolean
21
-
22
39
  def install code_or_file
23
40
  # might be better to pass in the options directly if we get more options
24
41
  installer = Railsthemes::Installer.new
42
+
43
+ if options[:email]
44
+ end
45
+
25
46
  installer.doc_popup = !options[:no_doc_popup]
26
- installer.verbose if options[:verbose]
27
- installer.debug if options[:debugging]
47
+ Railsthemes::Logging.verbose if options[:verbose]
48
+ Railsthemes::Logging.debug if options[:debugging]
28
49
 
29
50
  if options[:file]
30
51
  file = code_or_file
31
52
  abort 'Please specify a file to install from' unless file
32
- puts "Installing from file: #{file}."
33
53
  installer.install_from_file_system file
34
54
  else
35
55
  code = code_or_file
36
56
  abort 'Please specify a code to install from' unless code
37
- installer.download_from_code code
57
+ installer.install_from_code code
38
58
  end
39
59
  end
40
60
 
41
- desc "version", "See what version you have installed"
42
- def version
43
- puts Railsthemes::VERSION
44
- end
45
-
46
61
  # AP: other options could include list, remove, help, etc.
47
62
  end
48
63