nationsync 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/LICENSE.txt +21 -19
- data/README.md +21 -15
- data/bin/nationsync +4 -2
- data/lib/nationsync.rb +1 -1
- data/lib/nationsync/{commander.rb → cli.rb} +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68f87a6405d38aa1ffd8c2d97c8cd4bf3889c1d0
|
4
|
+
data.tar.gz: d8e3bc85f3e45d78777fdfd5de117309ed316ee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efe20747b024cd3af5d80201965feeeecfe259a4c5ef701503d17daf8b81769eca7b94483fa7cfff3fcffcb85020d24478cf2bbdd90cf8895c04eec05692c351
|
7
|
+
data.tar.gz: f6f20e84e34fd52cdbf52b33d42e3f401055a0bfa3e2ff387555914d6a071486651565007a70577935d558be5dabac9f1badb11d72f216efb95c463c96d13cea
|
data/.gitignore
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,22 +1,24 @@
|
|
1
1
|
Copyright (c) 2013 Dirk Gadsden
|
2
|
+
All rights reserved.
|
2
3
|
|
3
|
-
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
6
|
+
* Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
* Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
* The names of this software's contributors may not be used to endorse or
|
12
|
+
promote products derived from this software without specific prior
|
13
|
+
written permission.
|
4
14
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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.
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
16
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
17
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL Dirk Gadsden BE LIABLE FOR ANY
|
19
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
CHANGED
@@ -1,29 +1,35 @@
|
|
1
|
-
#
|
1
|
+
# NationSync
|
2
2
|
|
3
|
-
|
3
|
+
NationSync is a Ruby client for synchronizing a [NationBuilder](http://nationbuilder.com/) theme with a local directory. It allows you to edit theme files locally and have your changes automatically sent to the server.
|
4
|
+
|
5
|
+
The core of NationSync is the theme tool API used internally by the [NationBuilder Theme Sync for Mac](http://nationbuilder.com/theme_sync). As such this may break with the whims of the developers at NationBuilder. NationSync also uses the [Listen](https://github.com/guard/listen) gem from Guard to monitor the file system for changes, so it's *hopefully* cross-platform.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
|
9
|
+
It's easy:
|
10
|
+
|
11
|
+
gem install nationsync
|
8
12
|
|
9
|
-
|
13
|
+
## Usage
|
10
14
|
|
11
|
-
|
15
|
+
Make sure you are in the directory that you'll be syncing your theme into when running these commands!
|
12
16
|
|
13
|
-
|
17
|
+
### 1. Account setup
|
14
18
|
|
15
|
-
|
19
|
+
Next run `nationsync init`; this will prompt you for your domain, email, and password. It then authenticates with NationBuilder and saves its access token and session in `.nbconfig1`.
|
16
20
|
|
17
|
-
|
21
|
+
### 2. Theme setup
|
18
22
|
|
19
|
-
|
23
|
+
Run `nationsync pick_theme`; it will fetch a list of themes and allow you to pick one. Then run `nationsync fetch` to fetch theme files into the current directory. To pull new files or updated files run `nationsync fetch` again. (Running `nationsync clean` will also remove all NationSync theme files from the current directory, however it will leave the config file so you can then fetch again.)
|
20
24
|
|
21
|
-
|
25
|
+
### 3. Watching ###
|
26
|
+
|
27
|
+
`nationsync watch` will start watching the directory for changes and will upload any changed files to NationBuilder.
|
22
28
|
|
23
29
|
## Contributing
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
31
|
+
Fork and pull-request!
|
32
|
+
|
33
|
+
## License ##
|
34
|
+
|
35
|
+
Copyright 2013 Dirk Gadsden and released under a modified New BSD License. See LICENSE.txt for details.
|
data/bin/nationsync
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
|
5
|
-
|
4
|
+
if File.expand_path(File.dirname(__FILE__)).include? "nationsync/bin"
|
5
|
+
$:.unshift File.dirname(__FILE__) + '/../lib'
|
6
|
+
end
|
7
|
+
require 'nationsync/cli'
|
6
8
|
|
data/lib/nationsync.rb
CHANGED
@@ -68,7 +68,8 @@ class NationSyncThor < Thor
|
|
68
68
|
puts "- Skipping #{fn}"
|
69
69
|
end
|
70
70
|
type = MIME::Types.type_for(fn).first
|
71
|
-
|
71
|
+
is_binary = type && type.binary?
|
72
|
+
if is_binary
|
72
73
|
resp = @api.theme_asset_put_attachment(@config["theme_id"], fn, File.read(path))
|
73
74
|
else
|
74
75
|
resp = @api.theme_asset_put(@config["theme_id"], fn, File.read(path))
|
@@ -76,7 +77,7 @@ class NationSyncThor < Thor
|
|
76
77
|
|
77
78
|
if resp.status == 200
|
78
79
|
if resp.body["success"].to_s == "true"
|
79
|
-
puts "- Updated #{fn}" + (
|
80
|
+
puts "- Updated #{fn}" + (is_binary ? " (binary)" : "")
|
80
81
|
else
|
81
82
|
puts "- #{HL.color("Error", :red) } updating #{fn}:"
|
82
83
|
errors = resp.body["errors"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nationsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dirk Gadsden
|
@@ -139,7 +139,7 @@ files:
|
|
139
139
|
- lib/nationsync.rb
|
140
140
|
- lib/nationsync/api.rb
|
141
141
|
- lib/nationsync/auth.rb
|
142
|
-
- lib/nationsync/
|
142
|
+
- lib/nationsync/cli.rb
|
143
143
|
- nationsync.gemspec
|
144
144
|
homepage: http://github.com/dirk/nationsync
|
145
145
|
licenses:
|