rusic 0.0.4 → 1.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ruby-version +1 -0
- data/README.md +103 -17
- data/Rakefile +0 -4
- data/bin/rusic +1 -1
- data/lib/rusic/cli.rb +28 -10
- data/lib/rusic/deployer.rb +15 -0
- data/lib/rusic/generators/theme.rb +53 -0
- data/lib/rusic/templates/README.md +3 -0
- data/lib/rusic/templates/assets/bootstrap.css +5789 -0
- data/lib/rusic/templates/assets/bootstrap.js +1951 -0
- data/lib/rusic/templates/assets/cover.css +161 -0
- data/lib/rusic/templates/assets/glyphicons-halflings-regular.eot +0 -0
- data/lib/rusic/templates/assets/glyphicons-halflings-regular.svg +229 -0
- data/lib/rusic/templates/assets/glyphicons-halflings-regular.ttf +0 -0
- data/lib/rusic/templates/assets/glyphicons-halflings-regular.woff +0 -0
- data/lib/rusic/templates/ideas/edit.html.liquid +42 -0
- data/lib/rusic/templates/ideas/index.html.liquid +26 -14
- data/lib/rusic/templates/ideas/new.html.liquid +52 -0
- data/lib/rusic/templates/ideas/show.html.liquid +27 -0
- data/lib/rusic/templates/layouts/subdomain.html.liquid +57 -38
- data/lib/rusic/templates/pages/about.html.liquid +20 -0
- data/lib/rusic/theme_file.rb +43 -0
- data/lib/rusic/uploaders/asset.rb +40 -0
- data/lib/rusic/uploaders/editable_asset.rb +47 -0
- data/lib/rusic/uploaders/template.rb +40 -0
- data/lib/rusic/version.rb +1 -1
- data/lib/rusic.rb +10 -5
- data/rusic.gemspec +23 -23
- metadata +75 -86
- data/.rvmrc +0 -1
- data/TODO.md +0 -33
- data/features/rusic.feature +0 -16
- data/features/support/env.rb +0 -5
- data/lib/rusic/generators.rb +0 -59
- data/lib/rusic/idea.rb +0 -8
- data/lib/rusic/server.rb +0 -35
- data/lib/rusic/templates/rusic.yml +0 -6
- data/spec/rusic_spec.rb +0 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 04b06628fcb3ea10d731a13297b6fff30a54c8ae
|
4
|
+
data.tar.gz: 16224e5b3e04a79d11b2209f7e568d2ea7e137e7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 71de147e0b8749a0a06d645a88ab7f7ae73f91867c9edd6a5481f16f9b93c15d2a2151b20267b45021380850f0fb291be143bcc0f34bb2935632c830485b2163
|
7
|
+
data.tar.gz: 7ccf374220d447cb45128547c859746b7db32add10c87abee6c16719cc2d41acb67a17a00a2efdd73c45ca917de0faae1beac0765de430b28c0eba2bce31963b
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.1
|
data/README.md
CHANGED
@@ -1,31 +1,117 @@
|
|
1
|
-
|
2
|
-
=====
|
1
|
+
# Rusic
|
3
2
|
|
4
|
-
|
5
|
-
themes, as well as serve them from a local server.
|
3
|
+
Generate and deploy Rusic themes with ease.
|
6
4
|
|
7
|
-
|
5
|
+
This allows you to:
|
6
|
+
|
7
|
+
* Create a set of theme templates and assets
|
8
|
+
* Deploy those templates and assets to Rusic seamlessly
|
9
|
+
|
10
|
+
This mean you can develop themes on your local machine (using your editor of
|
11
|
+
choice) and see the changes live on Rusic immediately.
|
8
12
|
|
9
|
-
|
10
|
-
need to install the gem.
|
13
|
+
## Dependencies
|
11
14
|
|
12
|
-
|
15
|
+
* Ruby 1.9+
|
16
|
+
* Rubygems
|
17
|
+
|
18
|
+
## Install
|
13
19
|
|
14
|
-
|
20
|
+
$ gem install rusic
|
15
21
|
|
16
22
|
## Usage
|
17
23
|
|
18
|
-
|
19
|
-
|
24
|
+
```
|
25
|
+
$ rusic
|
26
|
+
Tasks:
|
27
|
+
rusic help [TASK] # Describe available tasks or one specific task
|
28
|
+
rusic new NAME # Create a new Rusic theme
|
29
|
+
rusic deploy # Upload theme to Rusic
|
30
|
+
```
|
31
|
+
|
32
|
+
### Generate new theme
|
33
|
+
|
34
|
+
```shell
|
35
|
+
$ rusic help new
|
36
|
+
Usage:
|
37
|
+
rusic new NAME
|
38
|
+
|
39
|
+
Create a new Rusic theme
|
40
|
+
```
|
41
|
+
|
42
|
+
For example, to create a new theme called "competition-theme"
|
43
|
+
|
44
|
+
```shell
|
45
|
+
$ rusic new competition-theme
|
46
|
+
create competition-theme
|
47
|
+
create competition-theme/README.md
|
48
|
+
create competition-theme/layouts
|
49
|
+
create competition-theme/layouts/subdomain.html.liquid
|
50
|
+
create competition-theme/ideas
|
51
|
+
create competition-theme/ideas/index.html.liquid
|
52
|
+
create competition-theme/ideas/new.html.liquid
|
53
|
+
create competition-theme/ideas/show.html.liquid
|
54
|
+
create competition-theme/ideas/edit.html.liquid
|
55
|
+
create competition-theme/pages
|
56
|
+
create competition-theme/pages/about.html.liquid
|
57
|
+
create competition-theme/assets
|
58
|
+
create competition-theme/assets/bootstrap.css
|
59
|
+
create competition-theme/assets/bootstrap.js
|
60
|
+
create competition-theme/assets/cover.css
|
61
|
+
create competition-theme/assets/glyphicons-halflings-regular.eot
|
62
|
+
create competition-theme/assets/glyphicons-halflings-regular.svg
|
63
|
+
create competition-theme/assets/glyphicons-halflings-regular.ttf
|
64
|
+
create competition-theme/assets/glyphicons-halflings-regular.woff
|
65
|
+
```
|
66
|
+
|
67
|
+
This will create a simple, bootstrapped theme
|
68
|
+
|
69
|
+
### Deploy theme
|
70
|
+
|
71
|
+
```shell
|
72
|
+
$ rusic help deploy
|
73
|
+
Usage:
|
74
|
+
rusic deploy
|
75
|
+
|
76
|
+
Options:
|
77
|
+
[--api-key=API_KEY]
|
78
|
+
[--api-host=API_HOST] # Default: api.rusic.com
|
79
|
+
[--theme=THEME]
|
80
|
+
[--watch]
|
81
|
+
|
82
|
+
Upload theme to Rusic
|
83
|
+
```
|
84
|
+
|
85
|
+
To deploy the "competition-theme" above, we would do
|
86
|
+
|
87
|
+
```shell
|
88
|
+
$ cd competition-theme/
|
89
|
+
$ rusic deploy --api-key YOUR_API_KEY --theme YOUR_THEME_ID
|
90
|
+
Saved layouts/subdomain.html.liquid
|
91
|
+
Saved ideas/edit.html.liquid
|
92
|
+
Saved ideas/index.html.liquid
|
93
|
+
Saved ideas/new.html.liquid
|
94
|
+
Saved ideas/show.html.liquid
|
95
|
+
Saved pages/about.html.liquid
|
96
|
+
Saved assets/bootstrap.css
|
97
|
+
Saved assets/bootstrap.js
|
98
|
+
Saved assets/cover.css
|
99
|
+
Saved assets/glyphicons-halflings-regular.eot
|
100
|
+
Saved assets/glyphicons-halflings-regular.svg
|
101
|
+
Saved assets/glyphicons-halflings-regular.ttf
|
102
|
+
Saved assets/glyphicons-halflings-regular.woff
|
103
|
+
```
|
20
104
|
|
21
|
-
|
22
|
-
rusic new example-theme
|
105
|
+
### Deploy on file changes
|
23
106
|
|
24
|
-
|
25
|
-
rusic server
|
107
|
+
Use the `--watch` flag to watch for changes on files and deploy them automatically
|
26
108
|
|
27
|
-
|
109
|
+
```
|
110
|
+
$ rusic deploy --api-key YOUR_API_KEY --theme YOUR_THEME_ID --watch
|
111
|
+
$ touch layouts/subdomain.html.liquid # in another process
|
112
|
+
Saved layouts/subdomain.html.liquid
|
113
|
+
```
|
28
114
|
|
29
115
|
MIT Licenced
|
30
116
|
|
31
|
-
Copyright
|
117
|
+
Copyright © 2011–2014, Simpleweb Ltd.
|
data/Rakefile
CHANGED
data/bin/rusic
CHANGED
data/lib/rusic/cli.rb
CHANGED
@@ -1,19 +1,37 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
|
5
|
-
require "rusic"
|
1
|
+
require 'thor'
|
2
|
+
require 'pathname'
|
3
|
+
require 'filewatcher'
|
6
4
|
|
7
5
|
module Rusic
|
8
6
|
class CLI < Thor
|
9
|
-
desc "new NAME", "Create a new
|
7
|
+
desc "new NAME", "Create a new Rusic theme"
|
10
8
|
def new(name)
|
11
|
-
Rusic::Generators::
|
9
|
+
Rusic::Generators::Theme.start([name])
|
12
10
|
end
|
13
11
|
|
14
|
-
desc "
|
15
|
-
|
16
|
-
|
12
|
+
desc "deploy", "Upload theme to Rusic"
|
13
|
+
method_option :api_key, type: :string
|
14
|
+
method_option :api_host, type: :string, default: 'api.rusic.com'
|
15
|
+
method_option :theme, type: :string
|
16
|
+
method_option :watch, type: :boolean
|
17
|
+
def deploy
|
18
|
+
path = Pathname.new('.')
|
19
|
+
files = []
|
20
|
+
|
21
|
+
files << Dir.glob(path.join('{layouts,ideas,pages}', '*.liquid'))
|
22
|
+
files << Dir.glob(path.join('assets', '*.*'))
|
23
|
+
|
24
|
+
files.flatten!
|
25
|
+
|
26
|
+
if options[:watch]
|
27
|
+
FileWatcher.new(files).watch(0.5) do |file|
|
28
|
+
deployer = Rusic::Deployer.new(file)
|
29
|
+
deployer.upload_files(options)
|
30
|
+
end
|
31
|
+
else
|
32
|
+
deployer = Rusic::Deployer.new(files)
|
33
|
+
deployer.upload_files(options)
|
34
|
+
end
|
17
35
|
end
|
18
36
|
end
|
19
37
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Rusic
|
2
|
+
class Deployer
|
3
|
+
attr_reader :files
|
4
|
+
|
5
|
+
def initialize(files)
|
6
|
+
@files = Array(files).map { |file| ThemeFile.new(file) }
|
7
|
+
end
|
8
|
+
|
9
|
+
def upload_files(options = {})
|
10
|
+
files.each do |file|
|
11
|
+
file.uploader.upload_file(options)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'thor/group'
|
3
|
+
|
4
|
+
module Rusic
|
5
|
+
module Generators
|
6
|
+
class Theme < Thor::Group
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
argument :name, type: :string
|
10
|
+
|
11
|
+
def self.source_root
|
12
|
+
File.dirname(__FILE__) + '/..'
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_project
|
16
|
+
empty_directory(name)
|
17
|
+
end
|
18
|
+
|
19
|
+
def readme
|
20
|
+
template('templates/README.md', "#{name}/README.md", name: name)
|
21
|
+
end
|
22
|
+
|
23
|
+
def layout
|
24
|
+
empty_directory("#{name}/layouts")
|
25
|
+
copy_file('templates/layouts/subdomain.html.liquid', "#{name}/layouts/subdomain.html.liquid")
|
26
|
+
end
|
27
|
+
|
28
|
+
def ideas
|
29
|
+
empty_directory("#{name}/ideas")
|
30
|
+
copy_file('templates/ideas/index.html.liquid', "#{name}/ideas/index.html.liquid")
|
31
|
+
copy_file('templates/ideas/new.html.liquid', "#{name}/ideas/new.html.liquid")
|
32
|
+
copy_file('templates/ideas/show.html.liquid', "#{name}/ideas/show.html.liquid")
|
33
|
+
copy_file('templates/ideas/edit.html.liquid', "#{name}/ideas/edit.html.liquid")
|
34
|
+
end
|
35
|
+
|
36
|
+
def pages
|
37
|
+
empty_directory("#{name}/pages")
|
38
|
+
copy_file('templates/pages/about.html.liquid', "#{name}/pages/about.html.liquid")
|
39
|
+
end
|
40
|
+
|
41
|
+
def assets
|
42
|
+
empty_directory("#{name}/assets")
|
43
|
+
copy_file('templates/assets/bootstrap.css', "#{name}/assets/bootstrap.css")
|
44
|
+
copy_file('templates/assets/bootstrap.js', "#{name}/assets/bootstrap.js")
|
45
|
+
copy_file('templates/assets/cover.css', "#{name}/assets/cover.css")
|
46
|
+
copy_file('templates/assets/glyphicons-halflings-regular.eot', "#{name}/assets/glyphicons-halflings-regular.eot")
|
47
|
+
copy_file('templates/assets/glyphicons-halflings-regular.svg', "#{name}/assets/glyphicons-halflings-regular.svg")
|
48
|
+
copy_file('templates/assets/glyphicons-halflings-regular.ttf', "#{name}/assets/glyphicons-halflings-regular.ttf")
|
49
|
+
copy_file('templates/assets/glyphicons-halflings-regular.woff', "#{name}/assets/glyphicons-halflings-regular.woff")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|