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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47004a0eb9003e44d868576c6602018869e8ada3
4
- data.tar.gz: 46577e6156117dd03dee5cdcb92729d6d36dc490
3
+ metadata.gz: 0df91f6ea89559f64d1dbcb2c0ab54466e94cb30
4
+ data.tar.gz: eabecbb89899843a440a777cfd94a1052f1e9b9c
5
5
  SHA512:
6
- metadata.gz: 5c665d7b4af97eab1fbc270c037b9aca02ededd5ce5dd49761f24ea41f09dcf84b7e8d27cb9a804d7b5b279e4e773c3b6465ebc396471b79ff03c30869f168eb
7
- data.tar.gz: 5276cb4b3ad6fa423b27c7a484d033f9148d299a8dc49f11bfe2bafdadf5a1919621418c13d7c015010909d7c47548a4682e4180ce8a59209cd87a54234c7680
6
+ metadata.gz: 8ac1d6f8ad9bc4f93467b65e83510de84abeaec976b80807036a7c4e817daa04c2bc2b8cf5cc437b7687f96a0a5afdcd66b4087aff8731a45dfee5002ae7757a
7
+ data.tar.gz: d67947ef81e4ca1dae32906a3a3b5ee7c9cd0a58d0b2970a1e22f2eb530a871d6d682af6c99b0cbe54df896bc4a0bc09d7d48e16382e0c503c59d65ef1e8c4c8
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .ruby-gemset
@@ -46,10 +46,15 @@ module Shopifydev
46
46
 
47
47
  modified = porcelain.scan(/^[ AM][M](.*)/).flatten.each {|f| f.strip!}
48
48
 
49
- remote_keys = modified.delete_if do |file|
50
- not ["assets", "snippets", "templates", "layout"].include?(file.split('/')[0].strip)
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 + "/*"].each do |remote_key|
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
 
@@ -2,7 +2,7 @@ require 'ffaker'
2
2
  require 'shopify_api'
3
3
  module Shopifydev
4
4
  module Faker
5
- extend ::Faker::ModuleUtils
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 = ::Faker::Lorem.word[0..rand(10)].downcase
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 = ::Faker::Lorem.word).length < 3);end
47
+ while((k = ::FFaker::Lorem.word).length < 3);end
48
48
  k.downcase
49
49
  end
50
50
 
51
51
  def value
52
- ::Faker::Lorem.sentence(rand(10) + 1)
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 = ::Faker::Name.first_name
81
- last_name = ::Faker::Name.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: ::Faker::AddressUS.street_address,
86
- phone: ::Faker::PhoneNumber.phone_number,
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 = ::Faker::Name.first_name
100
- last_name = ::Faker::Name.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: ::Faker::AddressCA.street_address,
105
- phone: ::Faker::PhoneNumber.phone_number,
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: ::Faker::Internet.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) + " " + ::Faker.bothify('#?#').upcase
1693
+ place[:postal_code] = place.delete(:fsa) + " " + ::FFaker.bothify('#?#').upcase
1694
1694
  place
1695
1695
  end
1696
1696
  end
@@ -1,3 +1,3 @@
1
1
  module Shopifydev
2
- VERSION = "0.0.28"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -38,8 +38,9 @@ Gem::Specification.new do |gem|
38
38
 
39
39
  # for generators
40
40
  gem.add_development_dependency "rake"
41
+ gem.add_development_dependency "rspec"
41
42
 
42
43
  # for fixtures
43
- gem.add_dependency 'ffaker'
44
+ gem.add_dependency 'ffaker', ">= 2.0"
44
45
 
45
46
  end
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Shopifydev::Faker" do
3
+ describe "Shopifydev::FFaker" do
4
4
  it "needs to have tests written"
5
5
  end
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.28
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: 2014-08-16 00:00:00.000000000 Z
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: ffaker
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: :runtime
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.2.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.