wordless 0.4.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f22b77e330965f615984ee5c3be29046326bf6e
4
- data.tar.gz: ab9e5f45f3cebe1001c0bea379908643b9c89a00
3
+ metadata.gz: 0b40aab8fcbc792a7f412619b33593ee6477724f
4
+ data.tar.gz: 08451c440d780863cf12d77a944cf52a3c84a0e2
5
5
  SHA512:
6
- metadata.gz: 7adeb159e0616070e27504d02f16cc7c3922c437bfa5fb26e84adc2859b07326fc4457d1107f7a500a5c7a220c5ced15fc0ce3d2a0d18a8cd8a812562f8fd758
7
- data.tar.gz: dcde2ab35695d7766e628ac9b18c366fc37ae6da4ef32aace5e005a4e085c6e2461c989955e518f35c11f1c3235ce81bf6bacdd70b204905891c109e5903ee1d
6
+ metadata.gz: b73dd76cd25890160cba93bbb9b62e36a1ce39c19a7004c02fda4ec0c126b76a2f7b5fdf8f85d5d8433ecb16f3e51788232b246c64c9c5865ce78a5fbd5bcbdb
7
+ data.tar.gz: 5574d056f5af9c9a06a066eb0358c6ac9aa27ec2793e34ac728bd26e827aa4adcb43226143b449999f5ea1e41e6de608bea65e70f9fc3f2d75f9103a755546cf
data/.gitignore CHANGED
@@ -1,2 +1,11 @@
1
- .DS_Store
2
- spec/fixtures/wordless
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /spec/fixtures/wordless
10
+ /tmp/*
11
+ !.keep
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.0
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Étienne Després
1
+ Copyright (c) 2012-2015 weLaika
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
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.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.mdown CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  A command line tool to help manage your [Wordless](http://welaika.github.com/wordless/)-based WordPress sites.
4
4
 
5
- [![Build Status](https://travis-ci.org/welaika/wordless_gem.png?branch=master)](https://travis-ci.org/welaika/wordless_gem)
5
+ [![Build Status](https://semaphoreapp.com/api/v1/projects/1b1be0c0-b8aa-4778-a644-675ca3f7b9e4/303149/shields_badge.svg)](https://semaphoreapp.com/welaika/wordless_gem)
6
6
 
7
7
  ## Premise
8
8
 
9
9
  This is a ruby-gem, so we expect you have already installed _ruby_; if it isn't
10
- the case, probably you'll like to take a look to [RVM](http://rvm.io).
10
+ the case, probably you'll like to take a look to [rbenv](https://github.com/sstephenson/rbenv).
11
11
 
12
- Wordless can't recognize if you are inside a wordpress' dirtree if you won't
13
- be in the root dir; so use it from the root dir. Easy peasy.
12
+ Wordless ~~can't~~ can recognize if you are inside a wordpress' dirtree if you ~~won't
13
+ be in the root dir~~ are in any subdirectory, starting from [commit df5e408](https://github.com/welaika/wordless_gem/commit/df5e408fcdcb54cccdf2e08c9a0c1873fbc675c4). ~~so use it from the root dir.~~ Easy peasy.
14
14
 
15
15
  ## Installation
16
16
 
@@ -35,9 +35,29 @@ Create a new Wordless-enabled WordPress site in directory `mysite`. This downloa
35
35
 
36
36
  wordless new mysite
37
37
 
38
- or
38
+ ```bash
39
+ Options:
40
+ [--force] # Overwrite existing WP-CLI / WP-CLI Server installation
41
+ -l, [--locale=LOCALE] # WordPress locale
42
+ # Default: en_US
43
+ -b, [--bare=BARE] # Remove default themes and plugins
44
+ # Default: true
45
+ [--admin-user=ADMIN_USER] # WordPress admin user
46
+ # Default: admin
47
+ [--admin-email=ADMIN_EMAIL] # WordPress admin email
48
+ # Default: admin@example.com
49
+ [--admin-password=ADMIN_PASSWORD] # WordPress admin password
50
+ # Default: password
51
+ [--db-user=DB_USER] # MySQL database user
52
+ # Default: root
53
+ [--db-password=DB_PASSWORD] # MySQL database pasword
54
+ [--site-url=SITE_URL] # Wordpress site URL
55
+ # Default: http://localhost:8080
56
+ ```
57
+
58
+ ##### caveats
39
59
 
40
- wordless new mysite --locale=fr_FR
60
+ - Default db-password is no password
41
61
 
42
62
  #### install
43
63
 
@@ -101,7 +121,14 @@ deploy_command: 'wordmove push -t'
101
121
 
102
122
  ## Running specs
103
123
 
104
- bundle install && ./setup_tests.sh && rspec
124
+ ```bash
125
+ bundle install && ./setup_tests.sh && rspec
126
+ ```
127
+
128
+ We've noticed problems running tests while using `rvm`; all of them solved using `rbenv`.
129
+ We have some clues about the problem, but we are ignoring it at the moment. We have switched
130
+ the CI tool to _sempaphore_, which use rbenv, so pull requests will be tested in a working
131
+ environement.
105
132
 
106
133
  ## Contributing
107
134
 
data/bin/autospec ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'autospec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'autospec')
data/bin/rspec ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'rspec')
data/exe/wordless ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path('../../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ require 'wordless'
7
+
8
+ Wordless::CLI.start
data/lib/wordless/cli.rb CHANGED
@@ -1,13 +1,7 @@
1
- require 'thor'
2
- require 'yaml'
3
- require 'net/http'
4
- require 'tempfile'
5
- require 'active_support/all'
6
- require 'wordless/wordless_cli'
7
-
8
1
  module Wordless
9
2
  class CLI < Thor
10
3
  include Thor::Actions
4
+ include WordPressTools::SharedOptions
11
5
 
12
6
  no_tasks do
13
7
  def wordless_cli
@@ -16,7 +10,8 @@ module Wordless
16
10
  end
17
11
 
18
12
  desc "new [NAME]", "Download WordPress in specified directory, install the Wordless plugin and create a Wordless theme"
19
- method_option :locale, :aliases => "-l", :desc => "WordPress locale (default is en_US)"
13
+ add_method_options(shared_options)
14
+ method_option :bare, type: :boolean, aliases: "-b", desc: "Remove default themes and plugins", default: true
20
15
  def new(name)
21
16
  wordless_cli.start(name)
22
17
  end
@@ -28,7 +23,7 @@ module Wordless
28
23
 
29
24
  desc "theme [NAME]", "Create a new Wordless theme NAME"
30
25
  def theme(name)
31
- wordless_cli.theme(name)
26
+ wordless_cli.create_theme(name)
32
27
  end
33
28
 
34
29
  desc "compile", "Compile static assets"
@@ -0,0 +1,55 @@
1
+ module Wordless
2
+ module CLIHelper
3
+
4
+ def info(message)
5
+ log_message message
6
+ end
7
+
8
+ def error(message)
9
+ log_message message, :red
10
+ exit
11
+ end
12
+
13
+ def success(message)
14
+ log_message message, :green
15
+ end
16
+
17
+ def warning(message)
18
+ log_message message, :yellow
19
+ end
20
+
21
+ def download(url, destination)
22
+ begin
23
+ f = open(destination, "wb")
24
+ f.write(open(url).read) ? true : false
25
+ rescue
26
+ false
27
+ ensure
28
+ f.close
29
+ end
30
+ end
31
+
32
+ def unzip(file, destination)
33
+ run_command "unzip #{file} -d #{destination}"
34
+ end
35
+
36
+ def git_installed?
37
+ run_command("git --version")
38
+ end
39
+
40
+ private
41
+
42
+ def log_message(message, color = nil)
43
+ say message, color
44
+ end
45
+
46
+ def void
47
+ RbConfig::CONFIG['host_os'] =~ /msdos|mswin|djgpp|mingw/ ? 'NUL' : '/dev/null'
48
+ end
49
+
50
+ def run_command(command)
51
+ system("#{command} >>#{void} 2>&1")
52
+ end
53
+
54
+ end
55
+ end
@@ -1,3 +1,3 @@
1
1
  module Wordless
2
- VERSION = "0.4.1"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,8 +1,6 @@
1
- require 'wordpress_tools/cli'
2
-
3
1
  module Wordless
4
2
  class WordlessCLI
5
- include WordPressTools::CLIHelper
3
+ include CLIHelper
6
4
  attr_reader :options, :thor
7
5
 
8
6
  module PATH
@@ -33,7 +31,7 @@ module Wordless
33
31
  @wordpress_dir ||= (
34
32
  current_dir = File.expand_path(current_dir)
35
33
 
36
- if File.exists? File.join(current_dir, wp_content_path)
34
+ if File.exist? File.join(current_dir, wp_content_path)
37
35
  current_dir
38
36
  elsif last_dir?(current_dir)
39
37
  raise StandardError, "Could not find a valid Wordpress directory"
@@ -53,7 +51,7 @@ module Wordless
53
51
 
54
52
  def config
55
53
  @@config ||= (
56
- if File.exists?(wordfile_path)
54
+ if File.exist?(wordfile_path)
57
55
  YAML::load(File.open(wordfile_path)).symbolize_keys
58
56
  else
59
57
  {}
@@ -73,10 +71,17 @@ module Wordless
73
71
  end
74
72
 
75
73
  def start(name)
76
- WordPressTools::CLI.new.invoke('new', [name], :bare => true, :locale => options['locale'])
74
+ WordPressTools::CLI.new.invoke('new', [name], options)
77
75
  Dir.chdir(name)
78
76
  install
79
- theme(name)
77
+ create_theme(name)
78
+ if wp_cli_installed?
79
+ activate_plugin
80
+ activate_theme(name)
81
+ set_permalinks
82
+ else
83
+ warning("WP-CLI is not installed. Cannot activate wordless plugin and theme")
84
+ end
80
85
  end
81
86
 
82
87
  def install
@@ -97,7 +102,25 @@ module Wordless
97
102
  end
98
103
  end
99
104
 
100
- def theme(name)
105
+ def activate_plugin
106
+ info("Activating wordless plugin...")
107
+ run_command("wp plugin activate wordless") || error("Cannot activate wordless plugin")
108
+ success("Done!")
109
+ end
110
+
111
+ def activate_theme(name)
112
+ info("Activating theme...")
113
+ run_command("wp theme activate #{name}") || error("Cannot activate theme '#{name}'")
114
+ success("Done!")
115
+ end
116
+
117
+ def set_permalinks
118
+ info("Setting permalinks for wordless...")
119
+ run_command("wp rewrite structure /%postname%/") || error("Cannot set permalinks")
120
+ success("Done!")
121
+ end
122
+
123
+ def create_theme(name)
101
124
  at_wordpress_root!
102
125
 
103
126
  if File.directory?(themes_path)
@@ -129,7 +152,7 @@ module Wordless
129
152
  static_js = Array(config[:static_js] || Dir['wp-content/themes/*/assets/javascripts/application.js'])
130
153
 
131
154
  (static_css + static_js).each do |file|
132
- FileUtils.rm_f(file) if File.exists?(file)
155
+ FileUtils.rm_f(file) if File.exist?(file)
133
156
  end
134
157
 
135
158
  success "Cleaned static assets."
@@ -173,7 +196,11 @@ module Wordless
173
196
  end
174
197
 
175
198
  def add_git_repo(repo, destination)
176
- run_command "git clone #{repo} #{destination}"
199
+ run_command("git clone #{repo} #{destination}")
200
+ end
201
+
202
+ def wp_cli_installed?
203
+ run_command("which wp")
177
204
  end
178
205
 
179
206
  end
data/lib/wordless.rb CHANGED
@@ -1 +1,12 @@
1
+ require "thor"
2
+ require "yaml"
3
+ require "net/http"
4
+ require "tempfile"
5
+ require "active_support/all"
6
+ require "open-uri"
7
+ require "wordpress_tools"
8
+
9
+ require "wordless/cli"
10
+ require "wordless/cli_helper"
1
11
  require "wordless/version"
12
+ require "wordless/wordless_cli"
data/wordless.gemspec CHANGED
@@ -1,29 +1,36 @@
1
- require File.expand_path('../lib/wordless/version', __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "wordless/version"
2
5
 
3
- Gem::Specification.new do |gem|
4
- gem.authors = ["Étienne Després", "Ju Liu"]
5
- gem.email = ["etienne@molotov.ca", "ju.liu@welaika.com"]
6
- gem.description = %q{Command line tool to manage Wordless themes.}
7
- gem.summary = %q{Manage Wordless themes.}
8
- gem.homepage = "http://github.com/welaika/wordless_gem"
9
- gem.license = "MIT"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "wordless"
8
+ spec.version = Wordless::VERSION
9
+ spec.authors = ["Étienne Després", "Alessandro Fazzi", "Filippo Gangi Dino", "Ju Liu", "Fabrizio Monti"]
10
+ spec.email = ["etienne@molotov.ca", "alessandro.fazzi@welaika.com", "filippo.gangidino@welaika.com", "ju.liu@welaika.com", "fabrizio.monti@welaika.com"]
11
+ spec.summary = %q{Manage Wordless themes.}
12
+ spec.description = %q{Command line tool to manage Wordless themes.}
13
+ spec.homepage = "http://github.com/welaika/wordless_gem"
14
+ spec.license = "MIT"
10
15
 
11
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
- gem.files = `git ls-files`.split("\n")
13
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
- gem.name = "wordless"
15
- gem.require_paths = ["lib"]
16
- gem.version = Wordless::VERSION
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
17
20
 
18
- gem.add_dependency "thor"
19
- gem.add_dependency "sprockets"
20
- gem.add_dependency "compass"
21
- gem.add_dependency "coffee-script"
22
- gem.add_dependency "yui-compressor"
23
- gem.add_dependency "activesupport"
24
- gem.add_dependency "wordpress_tools", '~> 0.0.2'
21
+ spec.required_ruby_version = ">= 2.1.2"
25
22
 
26
- gem.add_development_dependency 'rspec'
27
- gem.add_development_dependency 'fakeweb'
23
+ spec.add_dependency "thor", "~> 0.19.1"
24
+ spec.add_dependency "activesupport"
25
+ spec.add_dependency "sprockets"
26
+ spec.add_dependency "compass"
27
+ spec.add_dependency "coffee-script"
28
+ spec.add_dependency "yui-compressor"
29
+ spec.add_dependency "wordpress_tools", "~> 1.1.1"
30
+
31
+ spec.add_development_dependency "rspec", "< 3.0.0"
32
+ spec.add_development_dependency "fakeweb", "~> 1.3"
33
+ spec.add_development_dependency "pry-byebug", "~> 3.0"
34
+ spec.add_development_dependency "priscilla", "~> 1.0"
28
35
  end
29
36
 
metadata CHANGED
@@ -1,175 +1,204 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordless
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Étienne Després
7
+ - "Étienne Després"
8
+ - Alessandro Fazzi
9
+ - Filippo Gangi Dino
8
10
  - Ju Liu
11
+ - Fabrizio Monti
9
12
  autorequire:
10
- bindir: bin
13
+ bindir: exe
11
14
  cert_chain: []
12
- date: 2013-09-05 00:00:00.000000000 Z
15
+ date: 2015-02-20 00:00:00.000000000 Z
13
16
  dependencies:
14
17
  - !ruby/object:Gem::Dependency
15
18
  name: thor
16
19
  requirement: !ruby/object:Gem::Requirement
17
20
  requirements:
18
- - - '>='
21
+ - - "~>"
19
22
  - !ruby/object:Gem::Version
20
- version: '0'
23
+ version: 0.19.1
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - '>='
28
+ - - "~>"
26
29
  - !ruby/object:Gem::Version
27
- version: '0'
30
+ version: 0.19.1
28
31
  - !ruby/object:Gem::Dependency
29
- name: sprockets
32
+ name: activesupport
30
33
  requirement: !ruby/object:Gem::Requirement
31
34
  requirements:
32
- - - '>='
35
+ - - ">="
33
36
  - !ruby/object:Gem::Version
34
37
  version: '0'
35
38
  type: :runtime
36
39
  prerelease: false
37
40
  version_requirements: !ruby/object:Gem::Requirement
38
41
  requirements:
39
- - - '>='
42
+ - - ">="
40
43
  - !ruby/object:Gem::Version
41
44
  version: '0'
42
45
  - !ruby/object:Gem::Dependency
43
- name: compass
46
+ name: sprockets
44
47
  requirement: !ruby/object:Gem::Requirement
45
48
  requirements:
46
- - - '>='
49
+ - - ">="
47
50
  - !ruby/object:Gem::Version
48
51
  version: '0'
49
52
  type: :runtime
50
53
  prerelease: false
51
54
  version_requirements: !ruby/object:Gem::Requirement
52
55
  requirements:
53
- - - '>='
56
+ - - ">="
54
57
  - !ruby/object:Gem::Version
55
58
  version: '0'
56
59
  - !ruby/object:Gem::Dependency
57
- name: coffee-script
60
+ name: compass
58
61
  requirement: !ruby/object:Gem::Requirement
59
62
  requirements:
60
- - - '>='
63
+ - - ">="
61
64
  - !ruby/object:Gem::Version
62
65
  version: '0'
63
66
  type: :runtime
64
67
  prerelease: false
65
68
  version_requirements: !ruby/object:Gem::Requirement
66
69
  requirements:
67
- - - '>='
70
+ - - ">="
68
71
  - !ruby/object:Gem::Version
69
72
  version: '0'
70
73
  - !ruby/object:Gem::Dependency
71
- name: yui-compressor
74
+ name: coffee-script
72
75
  requirement: !ruby/object:Gem::Requirement
73
76
  requirements:
74
- - - '>='
77
+ - - ">="
75
78
  - !ruby/object:Gem::Version
76
79
  version: '0'
77
80
  type: :runtime
78
81
  prerelease: false
79
82
  version_requirements: !ruby/object:Gem::Requirement
80
83
  requirements:
81
- - - '>='
84
+ - - ">="
82
85
  - !ruby/object:Gem::Version
83
86
  version: '0'
84
87
  - !ruby/object:Gem::Dependency
85
- name: activesupport
88
+ name: yui-compressor
86
89
  requirement: !ruby/object:Gem::Requirement
87
90
  requirements:
88
- - - '>='
91
+ - - ">="
89
92
  - !ruby/object:Gem::Version
90
93
  version: '0'
91
94
  type: :runtime
92
95
  prerelease: false
93
96
  version_requirements: !ruby/object:Gem::Requirement
94
97
  requirements:
95
- - - '>='
98
+ - - ">="
96
99
  - !ruby/object:Gem::Version
97
100
  version: '0'
98
101
  - !ruby/object:Gem::Dependency
99
102
  name: wordpress_tools
100
103
  requirement: !ruby/object:Gem::Requirement
101
104
  requirements:
102
- - - ~>
105
+ - - "~>"
103
106
  - !ruby/object:Gem::Version
104
- version: 0.0.2
107
+ version: 1.1.1
105
108
  type: :runtime
106
109
  prerelease: false
107
110
  version_requirements: !ruby/object:Gem::Requirement
108
111
  requirements:
109
- - - ~>
112
+ - - "~>"
110
113
  - !ruby/object:Gem::Version
111
- version: 0.0.2
114
+ version: 1.1.1
112
115
  - !ruby/object:Gem::Dependency
113
116
  name: rspec
114
117
  requirement: !ruby/object:Gem::Requirement
115
118
  requirements:
116
- - - '>='
119
+ - - "<"
117
120
  - !ruby/object:Gem::Version
118
- version: '0'
121
+ version: 3.0.0
119
122
  type: :development
120
123
  prerelease: false
121
124
  version_requirements: !ruby/object:Gem::Requirement
122
125
  requirements:
123
- - - '>='
126
+ - - "<"
124
127
  - !ruby/object:Gem::Version
125
- version: '0'
128
+ version: 3.0.0
126
129
  - !ruby/object:Gem::Dependency
127
130
  name: fakeweb
128
131
  requirement: !ruby/object:Gem::Requirement
129
132
  requirements:
130
- - - '>='
133
+ - - "~>"
131
134
  - !ruby/object:Gem::Version
132
- version: '0'
135
+ version: '1.3'
133
136
  type: :development
134
137
  prerelease: false
135
138
  version_requirements: !ruby/object:Gem::Requirement
136
139
  requirements:
137
- - - '>='
140
+ - - "~>"
138
141
  - !ruby/object:Gem::Version
139
- version: '0'
142
+ version: '1.3'
143
+ - !ruby/object:Gem::Dependency
144
+ name: pry-byebug
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '3.0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - "~>"
155
+ - !ruby/object:Gem::Version
156
+ version: '3.0'
157
+ - !ruby/object:Gem::Dependency
158
+ name: priscilla
159
+ requirement: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - "~>"
162
+ - !ruby/object:Gem::Version
163
+ version: '1.0'
164
+ type: :development
165
+ prerelease: false
166
+ version_requirements: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - "~>"
169
+ - !ruby/object:Gem::Version
170
+ version: '1.0'
140
171
  description: Command line tool to manage Wordless themes.
141
172
  email:
142
173
  - etienne@molotov.ca
174
+ - alessandro.fazzi@welaika.com
175
+ - filippo.gangidino@welaika.com
143
176
  - ju.liu@welaika.com
177
+ - fabrizio.monti@welaika.com
144
178
  executables:
145
179
  - wordless
146
180
  extensions: []
147
181
  extra_rdoc_files: []
148
182
  files:
149
- - .gitignore
150
- - .rspec
151
- - .travis.yml
183
+ - ".gitignore"
184
+ - ".rspec"
185
+ - ".ruby-version"
152
186
  - Gemfile
153
- - Gemfile.lock
154
187
  - LICENSE
155
188
  - README.mdown
156
189
  - Rakefile
157
- - bin/wordless
190
+ - bin/autospec
191
+ - bin/rspec
192
+ - bin/setup.sh
193
+ - exe/wordless
158
194
  - lib/wordless.rb
159
195
  - lib/wordless/cli.rb
196
+ - lib/wordless/cli_helper.rb
160
197
  - lib/wordless/compile_assets.php
161
198
  - lib/wordless/theme_builder.php
162
199
  - lib/wordless/version.rb
163
200
  - lib/wordless/wordless_bridge.php
164
201
  - lib/wordless/wordless_cli.rb
165
- - setup_tests.sh
166
- - spec/cli_spec.rb
167
- - spec/fixtures/wordless_preferences.php
168
- - spec/fixtures/wordpress_stub.zip
169
- - spec/fixtures/zipped_file.zip
170
- - spec/spec_helper.rb
171
- - spec/support/capture.rb
172
- - spec/wordless/wordless_cli_spec.rb
173
202
  - wordless.gemspec
174
203
  homepage: http://github.com/welaika/wordless_gem
175
204
  licenses:
@@ -181,25 +210,18 @@ require_paths:
181
210
  - lib
182
211
  required_ruby_version: !ruby/object:Gem::Requirement
183
212
  requirements:
184
- - - '>='
213
+ - - ">="
185
214
  - !ruby/object:Gem::Version
186
- version: '0'
215
+ version: 2.1.2
187
216
  required_rubygems_version: !ruby/object:Gem::Requirement
188
217
  requirements:
189
- - - '>='
218
+ - - ">="
190
219
  - !ruby/object:Gem::Version
191
220
  version: '0'
192
221
  requirements: []
193
222
  rubyforge_project:
194
- rubygems_version: 2.0.3
223
+ rubygems_version: 2.4.5
195
224
  signing_key:
196
225
  specification_version: 4
197
226
  summary: Manage Wordless themes.
198
- test_files:
199
- - spec/cli_spec.rb
200
- - spec/fixtures/wordless_preferences.php
201
- - spec/fixtures/wordpress_stub.zip
202
- - spec/fixtures/zipped_file.zip
203
- - spec/spec_helper.rb
204
- - spec/support/capture.rb
205
- - spec/wordless/wordless_cli_spec.rb
227
+ test_files: []
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- install: bundle install
6
- before_script:
7
- - ./setup_tests.sh
8
- - gem install therubyracer
9
- - sudo apt-get update -qq
10
- - sudo apt-get install -qq php5-cli
data/Gemfile.lock DELETED
@@ -1,72 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- wordless (0.4.1)
5
- activesupport
6
- coffee-script
7
- compass
8
- sprockets
9
- thor
10
- wordpress_tools (~> 0.0.2)
11
- yui-compressor
12
-
13
- GEM
14
- remote: https://rubygems.org/
15
- specs:
16
- activesupport (4.0.0)
17
- i18n (~> 0.6, >= 0.6.4)
18
- minitest (~> 4.2)
19
- multi_json (~> 1.3)
20
- thread_safe (~> 0.1)
21
- tzinfo (~> 0.3.37)
22
- atomic (1.1.13)
23
- chunky_png (1.2.8)
24
- coffee-script (2.2.0)
25
- coffee-script-source
26
- execjs
27
- coffee-script-source (1.6.3)
28
- compass (0.12.2)
29
- chunky_png (~> 1.2)
30
- fssm (>= 0.2.7)
31
- sass (~> 3.1)
32
- diff-lcs (1.2.4)
33
- execjs (2.0.1)
34
- fakeweb (1.3.0)
35
- fssm (0.2.10)
36
- hike (1.2.3)
37
- i18n (0.6.5)
38
- minitest (4.7.5)
39
- multi_json (1.7.9)
40
- rack (1.5.2)
41
- rake (10.1.0)
42
- rspec (2.14.1)
43
- rspec-core (~> 2.14.0)
44
- rspec-expectations (~> 2.14.0)
45
- rspec-mocks (~> 2.14.0)
46
- rspec-core (2.14.5)
47
- rspec-expectations (2.14.2)
48
- diff-lcs (>= 1.1.3, < 2.0)
49
- rspec-mocks (2.14.3)
50
- sass (3.2.10)
51
- sprockets (2.10.0)
52
- hike (~> 1.2)
53
- multi_json (~> 1.0)
54
- rack (~> 1.0)
55
- tilt (~> 1.1, != 1.3.0)
56
- thor (0.18.1)
57
- thread_safe (0.1.2)
58
- atomic
59
- tilt (1.4.1)
60
- tzinfo (0.3.37)
61
- wordpress_tools (0.0.2)
62
- rake
63
- thor
64
- yui-compressor (0.11.0)
65
-
66
- PLATFORMS
67
- ruby
68
-
69
- DEPENDENCIES
70
- fakeweb
71
- rspec
72
- wordless!
data/bin/wordless DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'wordless/cli'
4
- Wordless::CLI.start
data/spec/cli_spec.rb DELETED
@@ -1,178 +0,0 @@
1
- require 'thor'
2
- require 'spec_helper'
3
-
4
- describe Wordless::CLI do
5
-
6
- let(:config) do
7
- { :wordless_repo => File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'wordless')) }
8
- end
9
-
10
- before do
11
- Wordless::WordlessCLI.class_variable_set(:@@config, config)
12
- end
13
-
14
- before do
15
- @original_wd = Dir.pwd
16
- Dir.chdir('tmp')
17
- end
18
-
19
- after do
20
- Dir.chdir(@original_wd)
21
- Dir["tmp/*"].each do |dir|
22
- FileUtils.rm_rf(dir) if File.directory? dir
23
- end
24
- end
25
-
26
- context "#new" do
27
- it "downloads a copy of WordPress, installs Wordless and creates a theme" do
28
- Wordless::CLI.start ['new', 'myapp']
29
- File.exists?('wp-content/index.php').should be_true
30
- (File.exists?('wp-content/plugins/plugin.php') || File.directory?('wp-content/themes/theme')).should be_false
31
- File.directory?('wp-content/plugins/wordless').should be_true
32
- File.directory?('wp-content/themes/myapp').should be_true
33
- File.exists?('wp-content/themes/myapp/index.php').should be_true
34
- end
35
- end
36
-
37
- context "without a valid WordPress install" do
38
- before do
39
- FileUtils.mkdir_p('wordpress/wp-content') && Dir.chdir('wordpress')
40
- end
41
-
42
- it "fails to install the Wordless plugin" do
43
- content = capture(:stdout) { Wordless::CLI.start ['install'] }
44
- content.should =~ %r|Directory 'wp-content/plugins' not found|
45
- end
46
-
47
- it "fails to create a Wordless theme" do
48
- content = capture(:stdout) { Wordless::CLI.start ['theme', 'mytheme'] }
49
- content.should =~ %r|Directory 'wp-content/themes' not found|
50
- end
51
- end
52
-
53
- context "#install" do
54
- before do
55
- WordPressTools::CLI.start ['new']
56
- Dir.chdir 'wordpress'
57
- end
58
-
59
- it "installs the Wordless plugin" do
60
- Wordless::CLI.start ['install']
61
- File.directory?('wp-content/plugins/wordless').should be_true
62
- end
63
- end
64
-
65
- context "#theme" do
66
- before do
67
- WordPressTools::CLI.start ['new']
68
- Dir.chdir 'wordpress'
69
- Wordless::CLI.start ['install']
70
- end
71
-
72
- it "creates a Wordless theme" do
73
- Wordless::CLI.start ['theme', 'mytheme']
74
- File.directory?('wp-content/themes/mytheme').should be_true
75
- File.exists?('wp-content/themes/mytheme/index.php').should be_true
76
- end
77
- end
78
-
79
- context "with a working Wordless install" do
80
- before do
81
- Wordless::CLI.start ['new', 'myapp']
82
- end
83
-
84
- context "#compile" do
85
- let(:compiled_css) { 'wp-content/themes/myapp/assets/stylesheets/screen.css' }
86
- let(:compiled_js) { 'wp-content/themes/myapp/assets/javascripts/application.js' }
87
-
88
- it "compiles static assets" do
89
- Wordless::CLI.start ['compile']
90
-
91
- File.exists?(compiled_css).should be_true
92
- File.exists?(compiled_js).should be_true
93
-
94
- File.readlines(compiled_css).grep(/html{line-height:1}/).should_not be_empty
95
- File.readlines(compiled_js).grep(/return "Yep, it works!";/).should_not be_empty
96
- end
97
- end
98
-
99
- context "#clean" do
100
- before do
101
- FileUtils.mkdir_p('wp-content/themes/myapp/assets/stylesheets')
102
- FileUtils.mkdir_p('wp-content/themes/myapp/assets/javascripts')
103
- end
104
-
105
- let(:default_css) { 'wp-content/themes/myapp/assets/stylesheets/screen.css' }
106
- let(:default_js) { 'wp-content/themes/myapp/assets/javascripts/application.js' }
107
-
108
- let(:first_css) { 'wp-content/themes/myapp/assets/stylesheets/foo.css' }
109
- let(:second_css) { 'wp-content/themes/myapp/assets/stylesheets/bar.css' }
110
- let(:first_js) { 'wp-content/themes/myapp/assets/javascripts/robin.js' }
111
- let(:second_js) { 'wp-content/themes/myapp/assets/javascripts/galahad.js' }
112
-
113
- it "should remove default default assets" do
114
- FileUtils.touch(default_css)
115
- FileUtils.touch(default_js)
116
-
117
- Wordless::CLI.start ['clean']
118
-
119
- File.exists?(default_css).should be_false
120
- File.exists?(default_js).should be_false
121
- end
122
-
123
- it "should remove assets specified on config" do
124
- Wordless::WordlessCLI.class_variable_set :@@config, {
125
- :static_css => [ first_css, second_css ],
126
- :static_js => [ first_js, second_js ]
127
- }
128
-
129
- [ first_css, second_css, first_js, second_js ].each do |file|
130
- FileUtils.touch(file)
131
- end
132
-
133
- Wordless::CLI.start ['clean']
134
-
135
- [ first_css, second_css, first_js, second_js ].each do |file|
136
- File.exists?(file).should be_false
137
- end
138
- end
139
- end
140
-
141
- context "#deploy" do
142
- let(:cli) { Wordless::CLI.new }
143
- let(:file) { 'shrubbery.txt' }
144
- let(:wordless_cli) { Wordless::WordlessCLI.new({}, Thor.new) }
145
-
146
- before do
147
- cli.stub(:wordless_cli).and_return(wordless_cli)
148
- Wordless::WordlessCLI.class_variable_set :@@config, {
149
- :deploy_command => "touch #{file}"
150
- }
151
- end
152
-
153
- it "should deploy via the deploy command" do
154
- cli.deploy
155
- File.exists?(file).should be_true
156
- end
157
-
158
- it "should compile and clean if refresh option is passed" do
159
- wordless_cli.should_receive(:compile).and_return(true)
160
- wordless_cli.should_receive(:clean).and_return(true)
161
- wordless_cli.stub(:options).and_return({ 'refresh' => true })
162
-
163
- cli.deploy
164
- end
165
-
166
- context "if a custom deploy is passed" do
167
- let(:file) { 'knights.txt' }
168
-
169
- it "should launch the custom deploy command" do
170
- wordless_cli.stub(:options).and_return({ 'command' => "touch #{file}" })
171
- cli.deploy
172
- File.exists?(file).should be_true
173
- end
174
- end
175
- end
176
- end
177
-
178
- end
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
- Wordless::set_preference("assets.preprocessors", array("SprocketsPreprocessor", "CompassPreprocessor"));
4
- Wordless::set_preference("css.compass_path", "<COMPASS_PATH>");
5
- Wordless::set_preference("js.ruby_path", "<RUBY_PATH>");
Binary file
Binary file
data/spec/spec_helper.rb DELETED
@@ -1,42 +0,0 @@
1
- require 'wordless/cli'
2
- require 'fakeweb'
3
- require 'thor'
4
-
5
- module WordPressTools
6
- module CLIHelper
7
- def exit; end
8
- def info(message); end
9
- def success(message); end
10
- end
11
- end
12
-
13
- module Wordless
14
- class WordlessCLI
15
- def error(message)
16
- puts message
17
- end
18
- end
19
- end
20
-
21
- require 'support/capture'
22
-
23
- WP_API_RESPONSE = <<-EOF
24
- upgrade
25
- http://wordpress.org/download/
26
- http://wordpress.org/wordpress-3.6.zip
27
- 3.6
28
- en_US
29
- 5.2.4
30
- 5.0
31
- EOF
32
-
33
- RSpec.configure do |config|
34
- config.before(:all) do
35
- FileUtils.mkdir('tmp') unless File.directory? 'tmp'
36
- FakeWeb.allow_net_connect = false
37
-
38
- FakeWeb.register_uri(:get, %r|http://api.wordpress.org/core/version-check/1.5/.*|, :body => WP_API_RESPONSE)
39
- FakeWeb.register_uri(:get, "http://wordpress.org/wordpress-3.6.zip", :body => File.expand_path('spec/fixtures/wordpress_stub.zip'))
40
- end
41
- end
42
-
@@ -1,18 +0,0 @@
1
- module CaptureHelpers
2
- def capture(stream)
3
- begin
4
- stream = stream.to_s
5
- eval "$#{stream} = StringIO.new"
6
- yield
7
- result = eval("$#{stream}").string
8
- ensure
9
- eval("$#{stream} = #{stream.upcase}")
10
- end
11
-
12
- result
13
- end
14
- end
15
-
16
- RSpec.configure do |config|
17
- config.include CaptureHelpers
18
- end
@@ -1,54 +0,0 @@
1
- require 'wordless/wordless_cli'
2
-
3
- describe Wordless::WordlessCLI do
4
- let(:cli) { Wordless::WordlessCLI.new }
5
-
6
- context "#wordpress_dir" do
7
- TMPDIR = "/tmp/wordless"
8
-
9
- let(:wp_content) { File.join(TMPDIR, "wp-content") }
10
-
11
- before do
12
- @original_dir = Dir.pwd
13
- FileUtils.mkdir(TMPDIR)
14
- Dir.chdir(TMPDIR)
15
- end
16
-
17
- after do
18
- Dir.chdir(@original_dir)
19
- FileUtils.rm_rf(TMPDIR)
20
- end
21
-
22
- context "if a wordpress directory is found" do
23
- before do
24
- FileUtils.mkdir(wp_content)
25
- end
26
-
27
- it 'returns the directory' do
28
- expect(cli.wordpress_dir).to eq(File.expand_path("."))
29
- end
30
- end
31
-
32
- context "if no wordpress directory is found" do
33
- it 'raises an error' do
34
- expect { cli.wordpress_dir }.to raise_error(StandardError)
35
- end
36
- end
37
-
38
- context "directory traversal" do
39
- before do
40
- FileUtils.mkdir(wp_content)
41
-
42
- @test_dir = File.join(TMPDIR, "test")
43
- FileUtils.mkdir(@test_dir)
44
- Dir.chdir(@test_dir)
45
- end
46
-
47
- it 'goes up through the directory tree and finds it' do
48
- expect(cli.wordpress_dir).to eq(File.expand_path("./.."))
49
- end
50
-
51
- end
52
- end
53
- end
54
-
File without changes