shopifydev 0.0.28 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/shopifydev/commands.rb +9 -4
- data/lib/shopifydev/faker.rb +4 -4
- data/lib/shopifydev/generators/templates/lib/shop.rb +23 -0
- data/lib/shopifydev/test/order_fixture.rb +9 -9
- data/lib/shopifydev/test/valid_postal_code.rb +1 -1
- data/lib/shopifydev/version.rb +1 -1
- data/shopifydev.gemspec +2 -1
- data/spec/shopifydev/faker_spec.rb +1 -1
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0df91f6ea89559f64d1dbcb2c0ab54466e94cb30
|
4
|
+
data.tar.gz: eabecbb89899843a440a777cfd94a1052f1e9b9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ac1d6f8ad9bc4f93467b65e83510de84abeaec976b80807036a7c4e817daa04c2bc2b8cf5cc437b7687f96a0a5afdcd66b4087aff8731a45dfee5002ae7757a
|
7
|
+
data.tar.gz: d67947ef81e4ca1dae32906a3a3b5ee7c9cd0a58d0b2970a1e22f2eb530a871d6d682af6c99b0cbe54df896bc4a0bc09d7d48e16382e0c503c59d65ef1e8c4c8
|
data/.gitignore
CHANGED
data/lib/shopifydev/commands.rb
CHANGED
@@ -46,10 +46,15 @@ module Shopifydev
|
|
46
46
|
|
47
47
|
modified = porcelain.scan(/^[ AM][M](.*)/).flatten.each {|f| f.strip!}
|
48
48
|
|
49
|
-
|
50
|
-
|
49
|
+
puts modified.inspect
|
50
|
+
|
51
|
+
top_level = ["assets", "snippets", "templates", "layout"]
|
52
|
+
remote_keys = modified.select do |file|
|
53
|
+
file.split('/').any? { |f| top_level.include?(f) }
|
51
54
|
end
|
52
55
|
|
56
|
+
puts remote_keys.inspect
|
57
|
+
|
53
58
|
remote_keys.each do |file|
|
54
59
|
`git add #{file}`
|
55
60
|
end
|
@@ -60,8 +65,8 @@ module Shopifydev
|
|
60
65
|
def upload_dir(upload_dir)
|
61
66
|
# upload all assets in the given dir
|
62
67
|
|
63
|
-
Dir[upload_dir + "
|
64
|
-
self.upload(remote_key)
|
68
|
+
Dir[upload_dir + "/**/*"].each do |remote_key|
|
69
|
+
self.upload([remote_key].squeeze("/"))
|
65
70
|
end
|
66
71
|
end
|
67
72
|
|
data/lib/shopifydev/faker.rb
CHANGED
@@ -2,7 +2,7 @@ require 'ffaker'
|
|
2
2
|
require 'shopify_api'
|
3
3
|
module Shopifydev
|
4
4
|
module Faker
|
5
|
-
extend ::
|
5
|
+
extend ::FFaker::ModuleUtils
|
6
6
|
extend self
|
7
7
|
|
8
8
|
NL = "\n"
|
@@ -31,7 +31,7 @@ module Shopifydev
|
|
31
31
|
def namespace
|
32
32
|
s = ''
|
33
33
|
loop do
|
34
|
-
word = ::
|
34
|
+
word = ::FFaker::Lorem.word[0..rand(10)].downcase
|
35
35
|
word = '.' + word if s.length > 0
|
36
36
|
if (s.length + word.length) < 21
|
37
37
|
s += word
|
@@ -44,12 +44,12 @@ module Shopifydev
|
|
44
44
|
|
45
45
|
def key
|
46
46
|
k = ""
|
47
|
-
while((k = ::
|
47
|
+
while((k = ::FFaker::Lorem.word).length < 3);end
|
48
48
|
k.downcase
|
49
49
|
end
|
50
50
|
|
51
51
|
def value
|
52
|
-
::
|
52
|
+
::FFaker::Lorem.sentence(rand(10) + 1)
|
53
53
|
end
|
54
54
|
|
55
55
|
def csv_value
|
@@ -0,0 +1,23 @@
|
|
1
|
+
equire "shopify_api"
|
2
|
+
require "pp"
|
3
|
+
require "inifile"
|
4
|
+
gem "shopify-api-limits"
|
5
|
+
|
6
|
+
class Shop
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
ShopifyAPI::Base.site = "https://#{credentials['api_key']}:#{credentials['password']}@#{credentials['store']}/admin"
|
10
|
+
end
|
11
|
+
|
12
|
+
def credentials
|
13
|
+
unless @credentials
|
14
|
+
inifile = File.join(File.dirname(__FILE__), '..', '.shopify-tmbundle')
|
15
|
+
ini = IniFile.new( File.read(inifile), :parameter => '=' )
|
16
|
+
using = ini['global']['use']
|
17
|
+
puts "using #{using}"
|
18
|
+
@credentials = ini[using]
|
19
|
+
end
|
20
|
+
@credentials
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -77,13 +77,13 @@ module Shopifydev
|
|
77
77
|
def us_address_attrs(opts={})
|
78
78
|
require_relative 'valid_zip'
|
79
79
|
place = ValidZip.valid_place
|
80
|
-
first_name = ::
|
81
|
-
last_name = ::
|
80
|
+
first_name = ::FFaker::Name.first_name
|
81
|
+
last_name = ::FFaker::Name.last_name
|
82
82
|
attrs = {
|
83
83
|
first_name: first_name,
|
84
84
|
last_name: last_name,
|
85
|
-
address1: ::
|
86
|
-
phone: ::
|
85
|
+
address1: ::FFaker::AddressUS.street_address,
|
86
|
+
phone: ::FFaker::PhoneNumber.phone_number,
|
87
87
|
city: place[:city],
|
88
88
|
province: place[:state],
|
89
89
|
country: "US",
|
@@ -96,13 +96,13 @@ module Shopifydev
|
|
96
96
|
def cad_address_attrs(opts={})
|
97
97
|
require_relative 'valid_postal_code'
|
98
98
|
place = ValidPostalCode.valid_place
|
99
|
-
first_name = ::
|
100
|
-
last_name = ::
|
99
|
+
first_name = ::FFaker::Name.first_name
|
100
|
+
last_name = ::FFaker::Name.last_name
|
101
101
|
attrs = {
|
102
102
|
first_name: first_name,
|
103
103
|
last_name: last_name,
|
104
|
-
address1: ::
|
105
|
-
phone: ::
|
104
|
+
address1: ::FFaker::AddressCA.street_address,
|
105
|
+
phone: ::FFaker::PhoneNumber.phone_number,
|
106
106
|
city: place[:city],
|
107
107
|
province: place[:province],
|
108
108
|
country: "CA",
|
@@ -152,7 +152,7 @@ module Shopifydev
|
|
152
152
|
billing_address: billing_address,
|
153
153
|
shipping_address: shipping_address,
|
154
154
|
financial_status: 'paid',
|
155
|
-
email: ::
|
155
|
+
email: ::FFaker::Internet.email
|
156
156
|
}.deep_merge(@order_defaults).deep_merge(opts)
|
157
157
|
end
|
158
158
|
|
@@ -1690,7 +1690,7 @@ module ValidPostalCode
|
|
1690
1690
|
end
|
1691
1691
|
def self.valid_place
|
1692
1692
|
place = valid_fsa
|
1693
|
-
place[:postal_code] = place.delete(:fsa) + " " + ::
|
1693
|
+
place[:postal_code] = place.delete(:fsa) + " " + ::FFaker.bothify('#?#').upcase
|
1694
1694
|
place
|
1695
1695
|
end
|
1696
1696
|
end
|
data/lib/shopifydev/version.rb
CHANGED
data/shopifydev.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopifydev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -221,19 +221,33 @@ dependencies:
|
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
224
|
+
name: rspec
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
227
|
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
229
|
version: '0'
|
230
|
-
type: :
|
230
|
+
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: ffaker
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '2.0'
|
244
|
+
type: :runtime
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '2.0'
|
237
251
|
description: Abstracts out and port to ruby the functionality of the shopify textmate
|
238
252
|
bundle for use in other editors. Provides a shopify console with the ability to
|
239
253
|
switch between configured shops, using either custom app or oauth token style authentication.
|
@@ -281,6 +295,7 @@ files:
|
|
281
295
|
- lib/shopifydev/generators/shop.rb
|
282
296
|
- lib/shopifydev/generators/templates/Gemfile
|
283
297
|
- lib/shopifydev/generators/templates/gitignore
|
298
|
+
- lib/shopifydev/generators/templates/lib/shop.rb
|
284
299
|
- lib/shopifydev/generators/templates/rvmrc
|
285
300
|
- lib/shopifydev/generators/templates/shopify-tmbundle
|
286
301
|
- lib/shopifydev/pry/commands.rb
|
@@ -325,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
325
340
|
version: '0'
|
326
341
|
requirements: []
|
327
342
|
rubyforge_project:
|
328
|
-
rubygems_version: 2.
|
343
|
+
rubygems_version: 2.4.3
|
329
344
|
signing_key:
|
330
345
|
specification_version: 4
|
331
346
|
summary: Tools for using SCM with shopify. Not Rails 4.0 ready.
|