wordless 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +49 -0
- data/LICENSE +22 -0
- data/README.md +22 -0
- data/Rakefile +2 -0
- data/bin/wordless +4 -0
- data/features/step_definitions/wordless_steps.rb +18 -0
- data/features/step_definitions/wordpress_steps.rb +13 -0
- data/features/support/env.rb +3 -0
- data/features/support/hooks.rb +3 -0
- data/features/wordpress.feature +6 -0
- data/lib/wordless/cli.rb +42 -0
- data/lib/wordless/version.rb +3 -0
- data/lib/wordless.rb +1 -0
- data/wordless.gemspec +24 -0
- metadata +122 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
wordless (0.0.1)
|
5
|
+
colored
|
6
|
+
thor
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
aruba (0.4.11)
|
12
|
+
childprocess (>= 0.2.3)
|
13
|
+
cucumber (>= 1.1.1)
|
14
|
+
ffi (>= 1.0.11)
|
15
|
+
rspec (>= 2.7.0)
|
16
|
+
builder (3.0.0)
|
17
|
+
childprocess (0.3.1)
|
18
|
+
ffi (~> 1.0.6)
|
19
|
+
colored (1.2)
|
20
|
+
cucumber (1.1.9)
|
21
|
+
builder (>= 2.1.2)
|
22
|
+
diff-lcs (>= 1.1.2)
|
23
|
+
gherkin (~> 2.9.0)
|
24
|
+
json (>= 1.4.6)
|
25
|
+
term-ansicolor (>= 1.0.6)
|
26
|
+
diff-lcs (1.1.3)
|
27
|
+
ffi (1.0.11)
|
28
|
+
gherkin (2.9.0)
|
29
|
+
json (>= 1.4.6)
|
30
|
+
json (1.6.5)
|
31
|
+
rspec (2.8.0)
|
32
|
+
rspec-core (~> 2.8.0)
|
33
|
+
rspec-expectations (~> 2.8.0)
|
34
|
+
rspec-mocks (~> 2.8.0)
|
35
|
+
rspec-core (2.8.0)
|
36
|
+
rspec-expectations (2.8.0)
|
37
|
+
diff-lcs (~> 1.1.2)
|
38
|
+
rspec-mocks (2.8.0)
|
39
|
+
term-ansicolor (1.0.7)
|
40
|
+
thor (0.14.6)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
aruba
|
47
|
+
cucumber
|
48
|
+
rspec
|
49
|
+
wordless!
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Étienne Després
|
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,22 @@
|
|
1
|
+
# Wordless
|
2
|
+
|
3
|
+
Command line tools to help manage your [Wordless](http://welaika.github.com/wordless/)-based WordPress sites.
|
4
|
+
|
5
|
+
WARNING: This gem is in early development and barely does anything useful yet.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
$ gem install wordless
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
`wordless wp mysite` creates a `mysite` directory and installs the latest stable release of WordPress.
|
14
|
+
`wordless wp --locale=fr_FR --bare` installs the latest French version of WordPress, and removes default plugins and themes.
|
15
|
+
|
16
|
+
## Contributing
|
17
|
+
|
18
|
+
1. Fork it
|
19
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
20
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
21
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
22
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/wordless
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Then /^the Wordless plugin should be installed$/ do
|
2
|
+
plugin_root = 'wp-content/plugins/wordless'
|
3
|
+
steps %Q{
|
4
|
+
Then the following files should exist:
|
5
|
+
| #{plugin_root}/wordless.php |
|
6
|
+
| #{plugin_root}/wordless/wordless.php |
|
7
|
+
}
|
8
|
+
end
|
9
|
+
|
10
|
+
Then /^a Wordless theme called "([^"]*)" should exist$/ do |name|
|
11
|
+
theme_root = "wp-content/themes/#{name}"
|
12
|
+
steps %Q{
|
13
|
+
Then the following files should exist:
|
14
|
+
| #{theme_root}/index.php |
|
15
|
+
| #{theme_root}/style.css |
|
16
|
+
| #{theme_root}/config/initializers/wordless_preferences.php |
|
17
|
+
}
|
18
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Then /^a WordPress installation should exist in directory "([^"]*)"$/ do |dir|
|
2
|
+
steps %Q{
|
3
|
+
Then the following files should exist:
|
4
|
+
| #{dir}/index.php |
|
5
|
+
| #{dir}/wp-activate.php |
|
6
|
+
| #{dir}/wp-config-sample.php |
|
7
|
+
| #{dir}/wp-settings.php |
|
8
|
+
Then the following directories should exist:
|
9
|
+
| #{dir}/wp-content |
|
10
|
+
| #{dir}/wp-admin |
|
11
|
+
| #{dir}/wp-includes |
|
12
|
+
}
|
13
|
+
end
|
data/lib/wordless/cli.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'net/http'
|
3
|
+
require 'colored'
|
4
|
+
|
5
|
+
module Wordless
|
6
|
+
class CLI < Thor
|
7
|
+
|
8
|
+
desc "wp DIR_NAME", "Downloads the latest stable version of WordPress in a new directory DIR_NAME (default is wordpress)"
|
9
|
+
method_option :locale, :aliases => "-l", :desc => "WordPress locale (default is en_US)"
|
10
|
+
method_option :bare, :aliases => "-b", :desc => "Remove default themes and plugins"
|
11
|
+
def wp(dir_name = 'wordpress')
|
12
|
+
download_url, version, locale = Net::HTTP.get('api.wordpress.org', "/core/version-check/1.5/?locale=#{options[:locale]}").split[2,3]
|
13
|
+
downloaded_file = Tempfile.new('wordpress')
|
14
|
+
begin
|
15
|
+
puts "Downloading WordPress #{version} (#{locale})...".green
|
16
|
+
`curl #{download_url} > #{downloaded_file.path} && unzip #{downloaded_file.path} -d #{dir_name}`
|
17
|
+
subdirectory = Dir["#{dir_name}/*/"].first # This is probably 'wordpress', but don't assume
|
18
|
+
FileUtils.mv Dir["#{subdirectory}*"], dir_name # Remove unnecessary directory level
|
19
|
+
FileUtils.rmdir subdirectory
|
20
|
+
ensure
|
21
|
+
downloaded_file.close
|
22
|
+
downloaded_file.unlink
|
23
|
+
end
|
24
|
+
|
25
|
+
puts %Q{Installed WordPress in directory "#{dir_name}"}.green
|
26
|
+
|
27
|
+
if options[:bare]
|
28
|
+
puts "Removing default themes and plugins...".green
|
29
|
+
dirs = %w(themes plugins).map {|d| "#{dir_name}/wp-content/#{d}"}
|
30
|
+
FileUtils.rm_rf dirs
|
31
|
+
FileUtils.mkdir dirs
|
32
|
+
dirs.each do |dir|
|
33
|
+
FileUtils.cp "#{dir_name}/wp-content/index.php", dir
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
puts "Done.".green
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
data/lib/wordless.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "wordless/version"
|
data/wordless.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/wordless/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Étienne Després"]
|
6
|
+
gem.email = ["etienne@molotov.ca"]
|
7
|
+
gem.description = %q{Wordless}
|
8
|
+
gem.summary = %q{Manage Wordless themes.}
|
9
|
+
gem.homepage = "http://github.com/etienne/wordless"
|
10
|
+
|
11
|
+
gem.add_dependency "thor"
|
12
|
+
gem.add_dependency "colored"
|
13
|
+
|
14
|
+
gem.add_development_dependency 'rspec'
|
15
|
+
gem.add_development_dependency "cucumber"
|
16
|
+
gem.add_development_dependency "aruba"
|
17
|
+
|
18
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
gem.files = `git ls-files`.split("\n")
|
20
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
gem.name = "wordless"
|
22
|
+
gem.require_paths = ["lib"]
|
23
|
+
gem.version = Wordless::VERSION
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wordless
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Étienne Després
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-03-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thor
|
16
|
+
requirement: &70127601371240 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70127601371240
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: colored
|
27
|
+
requirement: &70127601370740 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70127601370740
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &70127601370200 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70127601370200
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: cucumber
|
49
|
+
requirement: &70127601369600 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70127601369600
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: aruba
|
60
|
+
requirement: &70127601368820 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70127601368820
|
69
|
+
description: Wordless
|
70
|
+
email:
|
71
|
+
- etienne@molotov.ca
|
72
|
+
executables:
|
73
|
+
- wordless
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
80
|
+
- LICENSE
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/wordless
|
84
|
+
- features/step_definitions/wordless_steps.rb
|
85
|
+
- features/step_definitions/wordpress_steps.rb
|
86
|
+
- features/support/env.rb
|
87
|
+
- features/support/hooks.rb
|
88
|
+
- features/wordpress.feature
|
89
|
+
- lib/wordless.rb
|
90
|
+
- lib/wordless/cli.rb
|
91
|
+
- lib/wordless/version.rb
|
92
|
+
- wordless.gemspec
|
93
|
+
homepage: http://github.com/etienne/wordless
|
94
|
+
licenses: []
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 1.8.17
|
114
|
+
signing_key:
|
115
|
+
specification_version: 3
|
116
|
+
summary: Manage Wordless themes.
|
117
|
+
test_files:
|
118
|
+
- features/step_definitions/wordless_steps.rb
|
119
|
+
- features/step_definitions/wordpress_steps.rb
|
120
|
+
- features/support/env.rb
|
121
|
+
- features/support/hooks.rb
|
122
|
+
- features/wordpress.feature
|