marketplace-kit 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -9
- data/lib/marketplace_kit/commands/sync.rb +1 -1
- data/lib/marketplace_kit/services/api_driver.rb +0 -13
- data/lib/marketplace_kit/services/api_gateway.rb +11 -2
- data/lib/marketplace_kit/version.rb +1 -1
- data/marketplace_builder/custom_themes/default_custom_theme/example.png +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 965c2610386b1ea7b538bd7ab4dcc2c9166090a6
|
4
|
+
data.tar.gz: fb4e120590600721fea14f7165fdf2944f5658fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3c4343e23062f900fb4d12ac2d09865df2c0e5778c7163540309a8c70657c53eb1ebf65c84063217dc14430e7f15f955790499cefa79cf7bd1ea19b8e437763
|
7
|
+
data.tar.gz: 11fedeb439692bd884b598c304815e739df8145e4b4e2e9da8c574e167776a0c53ed0bc630e7aba40a117152b3e7360f0d70007b838b2a7462203d7f0e8658ee
|
data/README.md
CHANGED
@@ -13,6 +13,7 @@ Install it yourself as:
|
|
13
13
|
1. Go to marketplace folder you are working on
|
14
14
|
2. Ensure `marketplace_builder` directory exists
|
15
15
|
3. Create `marketplace_builder/.builder` file with endpoint names and their urls
|
16
|
+
|
16
17
|
```
|
17
18
|
{
|
18
19
|
"staging": {
|
@@ -24,26 +25,40 @@ Install it yourself as:
|
|
24
25
|
}
|
25
26
|
```
|
26
27
|
|
28
|
+
4. [Optional] `default`. Endpoint marked as default will be used if you do not pass any endpoint with `-e` flag.
|
29
|
+
|
30
|
+
```
|
31
|
+
{
|
32
|
+
"staging": {
|
33
|
+
"url": "https://staging-url.near-me.com",
|
34
|
+
"default": true
|
35
|
+
}
|
36
|
+
}
|
37
|
+
```
|
38
|
+
|
27
39
|
## Usage
|
40
|
+
|
28
41
|
`marketplace-kit <command> [flags]`
|
29
42
|
|
30
43
|
### Available flags
|
31
|
-
| Flag | For command | Description |
|
32
|
-
| ----------------- | ------------- | ------ |
|
33
|
-
| `-e <endpoint>` | all | Specifies endpoint. Endpoint name is the key inside the `.builder` config file |
|
34
|
-
| `-f` / `--force` | deploy | When added to deploy command it will deploy all the files (also those not changed) to specified endpoint |
|
35
44
|
|
45
|
+
| Flag | For command | Description |
|
46
|
+
| -------------------------- | ----------- | -------------------------------------------------------------------------------------------------------- |
|
47
|
+
| <pre>`-e <endpoint>`</pre> | all | Specifies endpoint. Endpoint name is the key inside the `.builder` config file |
|
48
|
+
| `-f`<br/>`--force` | deploy | When added to deploy command it will deploy all the files (also those not changed) to specified endpoint |
|
36
49
|
|
37
50
|
### Available commands
|
51
|
+
|
38
52
|
All commands should be run in the marketplace directory (ie. `marketplace-nearme/`)
|
39
53
|
|
40
|
-
| Command | Description
|
41
|
-
|
|
42
|
-
| `pull`
|
43
|
-
| `sync`
|
44
|
-
| `deploy` | Updates database using the filesystem as a source. By default this command is trying to send only files that changed since the last deploy
|
54
|
+
| Command | Description |
|
55
|
+
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
56
|
+
| `pull` | Pulls files from database and saves them in the filesystem |
|
57
|
+
| `sync` | Watches filesystem and updates specified endpoint on every file change inside `marketplace_builder` directory |
|
58
|
+
| `deploy` | Updates database using the filesystem as a source. By default this command is trying to send only files that changed since the last deploy |
|
45
59
|
|
46
60
|
### Examples
|
61
|
+
|
47
62
|
`marketplace-kit pull -e qa`
|
48
63
|
|
49
64
|
`marketplace-kit sync -e production`
|
@@ -20,7 +20,7 @@ module MarketplaceKit
|
|
20
20
|
|
21
21
|
def on_file_change(file_path)
|
22
22
|
log :sync_updating, file_path
|
23
|
-
response = gateway.send_file_change relative_file_path(file_path),
|
23
|
+
response = gateway.send_file_change relative_file_path(file_path), file_path
|
24
24
|
end
|
25
25
|
|
26
26
|
def relative_file_path(file_path)
|
@@ -39,7 +39,6 @@ module MarketplaceKit
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def prepare_body_to_send
|
42
|
-
fix_font_file_encoding
|
43
42
|
return @hash_body if @options[:multipart]
|
44
43
|
|
45
44
|
body_should_be_json? ? @hash_body.to_json : @hash_body
|
@@ -77,18 +76,6 @@ module MarketplaceKit
|
|
77
76
|
end
|
78
77
|
end
|
79
78
|
|
80
|
-
def fix_font_file_encoding
|
81
|
-
return unless font_file?
|
82
|
-
|
83
|
-
@hash_body[:marketplace_builder_file_body] = file_body.force_encoding('ISO-8859-1').encode('UTF-8')
|
84
|
-
end
|
85
|
-
|
86
|
-
FONT_TYPES = %w(.eot .otf .ttc .ttf .woff .woff2 .svg)
|
87
|
-
|
88
|
-
def font_file?
|
89
|
-
path && path.start_with?('custom_themes') && FONT_TYPES.include?(File.extname(path)) && file_body
|
90
|
-
end
|
91
|
-
|
92
79
|
def file_body
|
93
80
|
@hash_body[:marketplace_builder_file_body]
|
94
81
|
end
|
@@ -15,8 +15,17 @@ module MarketplaceKit
|
|
15
15
|
response.body['login_required']
|
16
16
|
end
|
17
17
|
|
18
|
-
def send_file_change(
|
19
|
-
|
18
|
+
def send_file_change(relative_file_path, file_path)
|
19
|
+
file = Faraday::UploadIO.new(file_path, 'application/octet-stream')
|
20
|
+
send_request(
|
21
|
+
:put,
|
22
|
+
'marketplace_releases/sync',
|
23
|
+
{
|
24
|
+
path: relative_file_path,
|
25
|
+
marketplace_builder_file_body: file
|
26
|
+
},
|
27
|
+
multipart: true
|
28
|
+
)
|
20
29
|
end
|
21
30
|
|
22
31
|
def get_deploy(deploy_id)
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marketplace-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Janeczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -217,6 +217,7 @@ files:
|
|
217
217
|
- lib/marketplace_kit/version.rb
|
218
218
|
- marketplace_builder/.builder
|
219
219
|
- marketplace_builder/.builder-autogenerated
|
220
|
+
- marketplace_builder/custom_themes/default_custom_theme/example.png
|
220
221
|
- marketplace_builder/custom_themes/default_custom_theme/foo.txt
|
221
222
|
- marketplace_builder/custom_themes/default_custom_theme/foo_unchanged.txt
|
222
223
|
- marketplace_builder/liquid_views/index.liquid
|