dougie 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.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +78 -0
- data/LICENSE.txt +22 -0
- data/README.md +55 -0
- data/Rakefile +1 -0
- data/bin/dougie +64 -0
- data/dougie.gemspec +27 -0
- data/lib/dougie/builder.rb +47 -0
- data/lib/dougie/configuration.rb +54 -0
- data/lib/dougie/constants.rb +6 -0
- data/lib/dougie/logger.rb +25 -0
- data/lib/dougie/syncer.rb +43 -0
- data/lib/dougie/version.rb +3 -0
- data/lib/dougie.rb +9 -0
- data/spec/builder_spec.rb +17 -0
- data/spec/configuration_spec.rb +65 -0
- data/spec/fixtures/.gitkeep +0 -0
- data/spec/fixtures/_stores.yml +9 -0
- data/spec/fixtures/config.yml +6 -0
- data/spec/spec_helper.rb +18 -0
- data/src/config.yml +7 -0
- data/src/stores.yml +9 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 210eabd79619ba075cdb81bd9b192f12848a6eb8
|
4
|
+
data.tar.gz: bdbdd0df7d4a4f866d1edfcf83fbb3885cf145da
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 501bfb6708d3b5a778510b858e825a30f1cf00418aba09a79507f8c256ef9d12644362e1caa9552f32f401206ce7f66e7e503096e0aaab4d2f0e211ed0324896
|
7
|
+
data.tar.gz: 5f1498f3290578da7818487bbbcc2f38184439bb4d6bcf97457af5799b1be76b01f4a12cd78fafbcab517ec10f0ff1a415a09105a887ce8e4c7dc33e0bc8f770
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dougie (0.0.1)
|
5
|
+
shopify_api (~> 3.2)
|
6
|
+
shopify_theme (~> 0.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activemodel (4.2.4)
|
12
|
+
activesupport (= 4.2.4)
|
13
|
+
builder (~> 3.1)
|
14
|
+
activeresource (4.0.0)
|
15
|
+
activemodel (~> 4.0)
|
16
|
+
activesupport (~> 4.0)
|
17
|
+
rails-observers (~> 0.1.1)
|
18
|
+
activesupport (4.2.4)
|
19
|
+
i18n (~> 0.7)
|
20
|
+
json (~> 1.7, >= 1.7.7)
|
21
|
+
minitest (~> 5.1)
|
22
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
23
|
+
tzinfo (~> 1.1)
|
24
|
+
addressable (2.4.0)
|
25
|
+
builder (3.2.2)
|
26
|
+
diff-lcs (1.2.5)
|
27
|
+
filewatcher (0.5.2)
|
28
|
+
trollop (~> 2.0)
|
29
|
+
httparty (0.13.3)
|
30
|
+
json (~> 1.8)
|
31
|
+
multi_xml (>= 0.5.2)
|
32
|
+
i18n (0.7.0)
|
33
|
+
json (1.8.3)
|
34
|
+
launchy (2.4.3)
|
35
|
+
addressable (~> 2.3)
|
36
|
+
mimemagic (0.2.1)
|
37
|
+
minitest (5.8.4)
|
38
|
+
multi_xml (0.5.5)
|
39
|
+
rails-observers (0.1.2)
|
40
|
+
activemodel (~> 4.0)
|
41
|
+
rake (10.5.0)
|
42
|
+
rspec (3.4.0)
|
43
|
+
rspec-core (~> 3.4.0)
|
44
|
+
rspec-expectations (~> 3.4.0)
|
45
|
+
rspec-mocks (~> 3.4.0)
|
46
|
+
rspec-core (3.4.1)
|
47
|
+
rspec-support (~> 3.4.0)
|
48
|
+
rspec-expectations (3.4.0)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.4.0)
|
51
|
+
rspec-mocks (3.4.1)
|
52
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
53
|
+
rspec-support (~> 3.4.0)
|
54
|
+
rspec-support (3.4.1)
|
55
|
+
shopify_api (3.2.1)
|
56
|
+
activeresource (>= 3.0.0)
|
57
|
+
thor (>= 0.14.4)
|
58
|
+
shopify_theme (0.0.21)
|
59
|
+
filewatcher
|
60
|
+
httparty (~> 0.13.0)
|
61
|
+
json (~> 1.8.0)
|
62
|
+
launchy
|
63
|
+
mimemagic
|
64
|
+
thor (>= 0.14.4)
|
65
|
+
thor (0.19.1)
|
66
|
+
thread_safe (0.3.5)
|
67
|
+
trollop (2.1.2)
|
68
|
+
tzinfo (1.2.2)
|
69
|
+
thread_safe (~> 0.1)
|
70
|
+
|
71
|
+
PLATFORMS
|
72
|
+
ruby
|
73
|
+
|
74
|
+
DEPENDENCIES
|
75
|
+
bundler (~> 1.7)
|
76
|
+
dougie!
|
77
|
+
rake (~> 10.0)
|
78
|
+
rspec (~> 3.3)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Michael Dijkstra
|
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,55 @@
|
|
1
|
+
# Dougie — A Shopify Workflow Gem
|
2
|
+
|
3
|
+
Dougie makes it easier for developers and designers to develop themes and deploy stores on Shopify.
|
4
|
+
|
5
|
+
## Benefits
|
6
|
+
|
7
|
+
+ Use your text editor of choice to edit theme files
|
8
|
+
+ Automatically keep theme files in sync
|
9
|
+
+ Manage multiple shops and themes at once
|
10
|
+
+ Easily switch between multiple themes/stores
|
11
|
+
|
12
|
+
## Features
|
13
|
+
|
14
|
+
1. Sync local theme files with live Shopify stores using the [Shopify Theme gem](https://github.com/Shopify/shopify_theme/)
|
15
|
+
2. Deploy your theme to development and production stores
|
16
|
+
|
17
|
+
## Planned Features
|
18
|
+
|
19
|
+
+ Copy products, collections, pages, blogs and articles between Shopify stores
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
```
|
24
|
+
gem install dougie
|
25
|
+
```
|
26
|
+
|
27
|
+
## The Bodega Workflow
|
28
|
+
|
29
|
+
1. `cd` into your theme folder
|
30
|
+
2. Run `$ doguie bootstrap`
|
31
|
+
4. Add your store API keys to `_stores.yml` file ([See instructions](https://github.com/XXIX/dougie/wiki/Theme-and-Store-Requirements))
|
32
|
+
5. Replace your development store with your theme by running: `$ dougie replace_theme`
|
33
|
+
6. Watch and sync your theme folder by running: `$ dougie watch`
|
34
|
+
7. Edit your theme files
|
35
|
+
8. Sync updates with production by running: `$ dougie sync_theme production`
|
36
|
+
|
37
|
+
## Building Locally
|
38
|
+
|
39
|
+
1. Clone it
|
40
|
+
2. Run `bundle`
|
41
|
+
3. Run `rake install`
|
42
|
+
|
43
|
+
## Publishing
|
44
|
+
|
45
|
+
1. Update the version number in `lib/dougie/version.rb`
|
46
|
+
2. Run `gem build dougie.gemspec`
|
47
|
+
3. Run `gem push dougie-0.0.X.gem`
|
48
|
+
|
49
|
+
## Contributing
|
50
|
+
|
51
|
+
1. Fork it ( https://github.com/xxix/dougie-gem/fork )
|
52
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
53
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
54
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
55
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/dougie
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'dougie'
|
4
|
+
|
5
|
+
def help
|
6
|
+
%Q(
|
7
|
+
Usage: dougie [COMMAND]
|
8
|
+
|
9
|
+
Commands:
|
10
|
+
bootstrap, bootstrap [FOLDER] Setup folder with default files
|
11
|
+
sync_theme [ENVIRONMENT] Push files modified since last sync to Shopify
|
12
|
+
replace_theme [ENVIRONMENT] Replace theme on Shopify
|
13
|
+
watch [ENVIRONMENT] Watch for changes and push to Shopify
|
14
|
+
help Prints this help document
|
15
|
+
version Prints the dougie gem version
|
16
|
+
|
17
|
+
Options:
|
18
|
+
-h, --help Prints this help document
|
19
|
+
-v, --version Prints the dougie gem version
|
20
|
+
|
21
|
+
See https://github.com/xxix/dougie for additional documentation.
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def bootstrap folder=nil
|
26
|
+
builder = Dougie::Builder.new
|
27
|
+
builder.setup folder
|
28
|
+
end
|
29
|
+
|
30
|
+
def replace_theme environment='development'
|
31
|
+
config = Dougie::Configuration.new environment: environment
|
32
|
+
syncer = Dougie::Syncer.new(config: config)
|
33
|
+
syncer.replace!
|
34
|
+
end
|
35
|
+
|
36
|
+
def sync_theme environment='development'
|
37
|
+
config = Dougie::Configuration.new environment: environment
|
38
|
+
syncer = Dougie::Syncer.new(config: config)
|
39
|
+
syncer.sync!
|
40
|
+
end
|
41
|
+
|
42
|
+
def watch environment='development'
|
43
|
+
config = Dougie::Configuration.new environment: environment
|
44
|
+
syncer = Dougie::Syncer.new(config: config)
|
45
|
+
syncer.watch
|
46
|
+
end
|
47
|
+
|
48
|
+
case ARGV[0]
|
49
|
+
when '-v', '--version', 'version'
|
50
|
+
puts Dougie::VERSION
|
51
|
+
when '-h', '--help', 'help'
|
52
|
+
puts help
|
53
|
+
when 'bootstrap'
|
54
|
+
bootstrap ARGV[1]
|
55
|
+
when 'replace_theme'
|
56
|
+
replace_theme ARGV[1]
|
57
|
+
when 'sync_theme'
|
58
|
+
sync_theme ARGV[1]
|
59
|
+
when 'watch'
|
60
|
+
watch ARGV[1]
|
61
|
+
else
|
62
|
+
puts "`#{ARGV[0]}` command not found.\n"
|
63
|
+
puts help
|
64
|
+
end
|
data/dougie.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'dougie/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "dougie"
|
8
|
+
spec.version = Dougie::VERSION
|
9
|
+
spec.authors = ["Michael Dijkstra"]
|
10
|
+
spec.email = ["michael@xxix.co"]
|
11
|
+
spec.summary = "A Shopify workflow gem"
|
12
|
+
spec.description = "Dougie makes it easier for developers and designers to develop themes and deploy stores on Shopify."
|
13
|
+
spec.homepage = "https://github.com/xxix/dougie"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = ['dougie']
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_runtime_dependency "shopify_theme", '~> 0.0'
|
22
|
+
spec.add_runtime_dependency "shopify_api", '~> 3.2'
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.3"
|
27
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Dougie
|
4
|
+
class Builder
|
5
|
+
attr_accessor :folder
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
end
|
9
|
+
|
10
|
+
def setup folder=nil
|
11
|
+
self.folder = "#{folder.chomp("/").reverse.chomp("/").reverse}/" if folder
|
12
|
+
setup_directory folder_path
|
13
|
+
setup_config
|
14
|
+
end
|
15
|
+
|
16
|
+
def folder_path
|
17
|
+
"#{ROOT}/#{folder}"
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def src_directory
|
23
|
+
spec = Gem::Specification.find_by_name("dougie")
|
24
|
+
"#{spec.gem_dir}/src/"
|
25
|
+
end
|
26
|
+
|
27
|
+
def create_src_file source, destination
|
28
|
+
unless File.exists?(destination)
|
29
|
+
contents = File.open("#{src_directory}#{source}").read
|
30
|
+
File.open(destination, 'w') { |file| file.write(contents) }
|
31
|
+
Dougie.logger.info "created #{destination}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def setup_directory path
|
36
|
+
unless File.exists?(path)
|
37
|
+
Dir.mkdir(path)
|
38
|
+
SmallVictories.logger.info "created #{path}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def setup_config
|
43
|
+
create_src_file('stores.yml', File.join(folder_path, '_stores.yml'))
|
44
|
+
create_src_file('config.yml', File.join(folder_path, 'config.yml'))
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Dougie
|
4
|
+
class Configuration
|
5
|
+
attr_accessor :shopify_config, :environment, :config
|
6
|
+
|
7
|
+
def initialize params={}
|
8
|
+
self.environment = (params[:environment] || DEFAULT_ENVIRONMENT).to_sym
|
9
|
+
self.config = File.exists?(CONFIG_FILE) ? YAML.load(File.read(CONFIG_FILE)) || {} : {}
|
10
|
+
self.shopify_config = File.exists?(SHOPIFY_CONFIG_FILE) ? YAML.load(File.read(SHOPIFY_CONFIG_FILE)) || {} : {}
|
11
|
+
Dougie.logger.info "Configured #{environment} store #{store}"
|
12
|
+
save_shopify_config
|
13
|
+
end
|
14
|
+
|
15
|
+
def config_file key
|
16
|
+
config[key.to_s].to_s.chomp("/").reverse.chomp("/").reverse if config.has_key?(key.to_s)
|
17
|
+
end
|
18
|
+
|
19
|
+
def api_key
|
20
|
+
config[environment][:api_key]
|
21
|
+
end
|
22
|
+
|
23
|
+
def password
|
24
|
+
config[environment][:password]
|
25
|
+
end
|
26
|
+
|
27
|
+
def store
|
28
|
+
config[environment][:store]
|
29
|
+
end
|
30
|
+
|
31
|
+
def ignore_files
|
32
|
+
(shopify_config[:ignore_files] || []).compact.map { |r| Regexp.new(r) }
|
33
|
+
end
|
34
|
+
|
35
|
+
def last_sync_at
|
36
|
+
config[environment][:last_sync_at] ||= Time.parse('2000-01-01 00:00:00')
|
37
|
+
end
|
38
|
+
|
39
|
+
def last_sync_at= last_sync_at
|
40
|
+
config[environment][:last_sync_at] = last_sync_at
|
41
|
+
end
|
42
|
+
|
43
|
+
def save
|
44
|
+
File.open(CONFIG_FILE, 'w') {|f| f.write config.to_yaml }
|
45
|
+
end
|
46
|
+
|
47
|
+
def save_shopify_config
|
48
|
+
shopify_config[:api_key] = api_key
|
49
|
+
shopify_config[:password] = password
|
50
|
+
shopify_config[:store] = store
|
51
|
+
File.open(SHOPIFY_CONFIG_FILE, 'w') {|f| f.write shopify_config.to_yaml }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
3
|
+
module Dougie
|
4
|
+
class << self
|
5
|
+
attr_writer :logger
|
6
|
+
|
7
|
+
def logger
|
8
|
+
@logger ||= Logger.new($stdout).tap do |log|
|
9
|
+
log.progname = self.name
|
10
|
+
log.formatter = proc do |severity, datetime, progname, msg|
|
11
|
+
string = "Bodega: "
|
12
|
+
case severity
|
13
|
+
when 'INFO'
|
14
|
+
string.concat("👍 ")
|
15
|
+
when 'WARN'
|
16
|
+
string.concat("⚠️ ")
|
17
|
+
when 'ERROR'
|
18
|
+
string.concat("🔥 ")
|
19
|
+
end
|
20
|
+
string.concat("#{msg}\n")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'shopify_theme'
|
2
|
+
require 'shopify_theme/cli'
|
3
|
+
|
4
|
+
module Dougie
|
5
|
+
class Syncer
|
6
|
+
attr_accessor :config
|
7
|
+
|
8
|
+
def initialize params={}
|
9
|
+
self.config = params[:config]
|
10
|
+
end
|
11
|
+
|
12
|
+
def cli
|
13
|
+
@cli ||= ShopifyTheme::Cli.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def files
|
17
|
+
Dir["**/*"]
|
18
|
+
end
|
19
|
+
|
20
|
+
def modified_files
|
21
|
+
files.select{ |file| !(config.ignore_files.any? { |ignore| file =~ /^#{ignore}/ } || File.directory?(file) || File.mtime(file).to_i < config.last_sync_at.to_time.to_i) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def replace!
|
25
|
+
cli.replace
|
26
|
+
cli.upload 'config/settings_data.json'
|
27
|
+
end
|
28
|
+
|
29
|
+
def save_config
|
30
|
+
config.last_sync_at = Time.now
|
31
|
+
config.save
|
32
|
+
end
|
33
|
+
|
34
|
+
def sync!
|
35
|
+
modified_files.each { |file| cli.upload file }
|
36
|
+
save_config
|
37
|
+
end
|
38
|
+
|
39
|
+
def watch
|
40
|
+
cli.watch
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/dougie.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
libdir = File.dirname(__FILE__)
|
2
|
+
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
3
|
+
|
4
|
+
require "dougie/version"
|
5
|
+
require "dougie/constants"
|
6
|
+
require "dougie/configuration"
|
7
|
+
require "dougie/logger"
|
8
|
+
require "dougie/builder"
|
9
|
+
require "dougie/syncer"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Dougie do
|
4
|
+
let(:builder) { Dougie::Builder.new }
|
5
|
+
|
6
|
+
context 'with folder' do
|
7
|
+
it 'sets up default files' do
|
8
|
+
builder.setup 'spec/fixtures/new'
|
9
|
+
expect(File.exists?('fixtures/new/_stores.yml')).to eq true
|
10
|
+
expect(File.exists?('fixtures/new/config.yml')).to eq true
|
11
|
+
end
|
12
|
+
|
13
|
+
after do
|
14
|
+
%w(fixtures/new/_stores.yml fixtures/new/config.yml).each { |path| clean_file(path) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Dougie do
|
4
|
+
let(:configuration) { Dougie::Configuration.new }
|
5
|
+
|
6
|
+
context 'with config file' do
|
7
|
+
before do
|
8
|
+
FileUtils.cp('fixtures/_stores.yml', './')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'defaults to development environment' do
|
12
|
+
expect(configuration.environment).to eq :development
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'loads development api key' do
|
16
|
+
expect(configuration.api_key).to eq 'dev-api-key'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'loads development password' do
|
20
|
+
expect(configuration.password).to eq 'dev-password'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'loads development store' do
|
24
|
+
expect(configuration.store).to eq 'dev-store'
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'with shopify config file' do
|
28
|
+
before do
|
29
|
+
FileUtils.cp('fixtures/config.yml', './')
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'sets api key' do
|
33
|
+
expect(configuration.shopify_config[:api_key]).to eq configuration.api_key
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'sets password' do
|
37
|
+
expect(configuration.shopify_config[:password]).to eq configuration.password
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'sets store' do
|
41
|
+
expect(configuration.shopify_config[:store]).to eq configuration.store
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context 'for production' do
|
46
|
+
let(:production_configuration) { Dougie::Configuration.new environment: :production }
|
47
|
+
|
48
|
+
it 'defaults to development environment' do
|
49
|
+
expect(production_configuration.environment).to eq :production
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'loads production api key' do
|
53
|
+
expect(production_configuration.api_key).to eq 'prod-api-key'
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'loads production password' do
|
57
|
+
expect(production_configuration.password).to eq 'prod-password'
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'loads production store' do
|
61
|
+
expect(production_configuration.store).to eq 'prod-store'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
File without changes
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
Bundler.setup
|
3
|
+
|
4
|
+
require 'dougie'
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.before do
|
8
|
+
FileUtils.cd File.dirname(__FILE__)
|
9
|
+
end
|
10
|
+
|
11
|
+
config.after do
|
12
|
+
%w(./_stores.yml ./config.yml).each { |path| clean_file(path) }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def clean_file path
|
17
|
+
FileUtils.rm(path) if File.exists?(path)
|
18
|
+
end
|
data/src/config.yml
ADDED
data/src/stores.yml
ADDED
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dougie
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Dijkstra
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: shopify_theme
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: shopify_api
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.3'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.3'
|
83
|
+
description: Dougie makes it easier for developers and designers to develop themes
|
84
|
+
and deploy stores on Shopify.
|
85
|
+
email:
|
86
|
+
- michael@xxix.co
|
87
|
+
executables:
|
88
|
+
- dougie
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/dougie
|
99
|
+
- dougie.gemspec
|
100
|
+
- lib/dougie.rb
|
101
|
+
- lib/dougie/builder.rb
|
102
|
+
- lib/dougie/configuration.rb
|
103
|
+
- lib/dougie/constants.rb
|
104
|
+
- lib/dougie/logger.rb
|
105
|
+
- lib/dougie/syncer.rb
|
106
|
+
- lib/dougie/version.rb
|
107
|
+
- spec/builder_spec.rb
|
108
|
+
- spec/configuration_spec.rb
|
109
|
+
- spec/fixtures/.gitkeep
|
110
|
+
- spec/fixtures/_stores.yml
|
111
|
+
- spec/fixtures/config.yml
|
112
|
+
- spec/spec_helper.rb
|
113
|
+
- src/config.yml
|
114
|
+
- src/stores.yml
|
115
|
+
homepage: https://github.com/xxix/dougie
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
metadata: {}
|
119
|
+
post_install_message:
|
120
|
+
rdoc_options: []
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
requirements: []
|
134
|
+
rubyforge_project:
|
135
|
+
rubygems_version: 2.4.5
|
136
|
+
signing_key:
|
137
|
+
specification_version: 4
|
138
|
+
summary: A Shopify workflow gem
|
139
|
+
test_files:
|
140
|
+
- spec/builder_spec.rb
|
141
|
+
- spec/configuration_spec.rb
|
142
|
+
- spec/fixtures/.gitkeep
|
143
|
+
- spec/fixtures/_stores.yml
|
144
|
+
- spec/fixtures/config.yml
|
145
|
+
- spec/spec_helper.rb
|