voog-kit 0.2.0 → 0.2.1

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: e1c88db6b03fc5e1e036dd8ed3df13bb2f5cb1b2
4
- data.tar.gz: eb9caf57e75c716860c4c2b719d5f283a8cd090a
3
+ metadata.gz: ac0a57de7355211889a4cec2cd4c62b405e5f2ac
4
+ data.tar.gz: 524285b8c42a5f49aa0bfbbdd6e5bb46172e5a82
5
5
  SHA512:
6
- metadata.gz: 621fd03b7e3dfdbd2801bff9df93337cdbaf93b329de9b71fcc99579b4cb329bca156746ac41c39be6fc3a56a0a5b73adec06b78852084cb3daf18b2fabd75a4
7
- data.tar.gz: 2771bf3cad4702850652021296b9e3fa1253bf090b125206885e6954b29fdbb4de6459d3a42cd2bf3ba94fe57b2d0fbda98111681d15e9c24b3373c719af1ecd
6
+ metadata.gz: b47f316dc4afa5877e979e46363c2497047ccb04a9b4beba5694c182466b8967c54d558842ba9f7563c1808aa7efa31b869d757cf202bb7eeba308fd61f7706c
7
+ data.tar.gz: 2b18928b4acf862ab8857094c1eb007dacd1cea452d19280907edbc298aab3d947ad0bcc9edb4d1fff2de631639062e033169554443eedb00af1af1476aedf5d
data/README.markdown CHANGED
@@ -1,9 +1,9 @@
1
1
  # Voog Developer Toolkit
2
2
 
3
- The Voog Designer Toolkit is a simple Ruby script that simplifies the editing
4
- of [Voog site](http://www.voog.com) templates. It acts as a push-pull mechanism that allows you to
5
- fetch all layout files, work on them locally and upload them without having to
6
- use the browser-based code editor.
3
+ The Voog Designer Toolkit is a simple command-line tool that simplifies the editing
4
+ of [Voog](http://www.voog.com) sites. It allows you to pull the layout files to your
5
+ own computer and push them back online after you've finished. There are also other
6
+ utility commands, described below.
7
7
 
8
8
  ## Installation
9
9
 
@@ -16,16 +16,56 @@ $ gem install voog-kit
16
16
  This installs the main tool, `kit`, which is added to your system's $PATH, which
17
17
  means it can be run from anywhere in your system.
18
18
 
19
- If you want to explicitly use latest version of the [Voog API client](https://github.com/Edicy/voog.rb):
20
19
 
21
- ```bash
22
- $ git pull https://github.com/Edicy/voog.rb voog-api
23
- $ cd voog-api
24
- $ bundle install
25
- $ rake install
20
+ ### API token
21
+ To use the toolkit, you have to generate your API token from your profile settings
22
+ page (http://yoursite.voog.com/admin/people/profile).
23
+ ![generating the API token](https://dl.dropboxusercontent.com/u/10145790/generating_api_token.png)
24
+
25
+ You should see something like this:
26
+
27
+ ![API token is generated](https://dl.dropboxusercontent.com/u/10145790/api_token_generated.png)
28
+
29
+ Without this token, *kit* will not allow you to access or change your layout files.
30
+
31
+ ## Basic usage
32
+
33
+ The most straightforward usage for `kit` is to synchronize layout files between the
34
+ live site and your local machine.
35
+
36
+ After following the voog-kit installation instruction, you set up `kit` and also generated an API token: `0809d0c93c53438d435b2073d2cf2d22` for your customisite
37
+ at `mysite.voog.com`. This is essentially all you need to get started.
38
+
39
+ ### Downloading the layout
40
+
41
+ Let's start.
42
+
43
+ `kit pull -h mysite.voog.com -t 0809d0c93c53438d435b2073d2cf2d22` downloads the layout files
44
+ from *mysite.voog.com* using the API token *0809d0c93c53438d435b2073d2cf2d22*. This creates
45
+ the necessary folders to hold the files, so the file structure stays the same as in the
46
+ online code editor.
47
+
48
+ The current folder structure should be something like this:
26
49
  ```
50
+ ./
51
+ assets/
52
+ components/
53
+ images/
54
+ javascripts/
55
+ layouts/
56
+ stylesheets/
57
+ ```
58
+
59
+ As you can see, kit also generated a *manifest.json* file to hold the metadata to along with
60
+ the layout files. This is later used when checking for missing files and uploading everything back up.
61
+
62
+ There's also a *.voog* file that holds your hostname and API token so you don't have to provide them
63
+ every time:
64
+
65
+
66
+ ### Uploading the changes
27
67
 
28
- ## Basic commands
68
+ ## Commands
29
69
 
30
70
  * `init` - Initializes the local folder structure and files for a site
31
71
  * `manifest` - Generates a `manifest.json` file from the site's layout and asset files
@@ -37,7 +77,7 @@ $ rake install
37
77
 
38
78
  Most commands need to know your site's URL and you personal API token to properly authorize all
39
79
  requests. For this you can either provide them with `--token/-t` and `--host/-h`
40
- flags, e.g `kit pull -t afcf30182aecfc8155d390d7d4552d14 -h mysite.voog.com`. If there's a '.voog' file
80
+ flags, e.g `kit pull -t 0809d0c93c53438d435b2073d2cf2d22 -h mysite.voog.com`. If there's a '.voog' file
41
81
  present in the current folder, it takes the options from there.
42
82
 
43
83
  There's also a `--site/-s` argument that is used to choose a configuration block from the `.voog` file.
@@ -47,7 +87,7 @@ Example `.voog` file:
47
87
  ```
48
88
  [site1]
49
89
  host=mysite.voog.com
50
- api_token=afcf30182aecfc8155d390d7d4552d14
90
+ api_token=0809d0c93c53438d435b2073d2cf2d22
51
91
  [site2]
52
92
  host=site2.customdomain.co
53
93
  api_token=5d390d7d4552d14afcf30182aecfc815
@@ -69,7 +109,7 @@ To enable overwriting for all commands, you can add it to the site's configurati
69
109
  ```
70
110
  [site1]
71
111
  host=mysite.voog.com
72
- api_token=afcf30182aecfc8155d390d7d4552d14
112
+ api_token=0809d0c93c53438d435b2073d2cf2d22
73
113
  overwrite=true
74
114
  ```
75
115
 
@@ -146,6 +186,15 @@ options and commands with a brief description. `kit help <command>` shows inform
146
186
  manifest.json
147
187
  ```
148
188
 
189
+ If you want to explicitly use latest version of the [Voog API client](https://github.com/Edicy/voog.rb):
190
+
191
+ ```bash
192
+ $ git pull https://github.com/Edicy/voog.rb voog-api
193
+ $ cd voog-api
194
+ $ bundle install
195
+ $ rake install
196
+ ```
197
+
149
198
  ## Contributing
150
199
 
151
200
  1. Fork it
data/bin/kit CHANGED
@@ -193,11 +193,12 @@ pre do |global, command, options, args|
193
193
  host = global.fetch(:host, nil) || options.fetch(:host, nil)
194
194
  api_token = global.fetch(:token, nil) || options.fetch(:token, nil)
195
195
 
196
- if host && api_token && @config_block
196
+ if host && api_token
197
197
  Voog::Dtk.write_config({
198
198
  host: host,
199
199
  api_token: api_token,
200
- block: @config_block,
200
+ overwrite: overwrite,
201
+ block: @config_block || host,
201
202
  overwrite: overwrite
202
203
  })
203
204
  end
data/lib/voog/dtk.rb CHANGED
@@ -50,13 +50,14 @@ module Voog
50
50
  host = opts.fetch(:host, '')
51
51
  api_token = opts.fetch(:api_token, '')
52
52
  silent = opts.fetch(:silent, false)
53
+ overwrite = opts.fetch(:overwrite, false)
53
54
 
54
55
  @file = if config_exists?
55
56
  CONFIG_FILENAME
56
57
  elsif global_config_exists?
57
58
  [ENV['HOME'], CONFIG_FILENAME].join('/')
58
59
  else
59
- File.new(CONFIG_FILENAME)
60
+ File.new(CONFIG_FILENAME, 'w+')
60
61
  CONFIG_FILENAME
61
62
  end
62
63
 
@@ -1,5 +1,5 @@
1
1
  module Voog
2
2
  module Dtk
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voog-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikk Pristavka
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-29 00:00:00.000000000 Z
12
+ date: 2014-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  version: '0'
220
220
  requirements: []
221
221
  rubyforge_project:
222
- rubygems_version: 2.2.1
222
+ rubygems_version: 2.2.0
223
223
  signing_key:
224
224
  specification_version: 4
225
225
  summary: Voog Developer Toolkit