rusic 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/README.md +65 -0
- data/Rakefile +6 -0
- data/bin/rusic +4 -0
- data/features/rusic.feature +16 -0
- data/features/support/env.rb +5 -0
- data/lib/rusic.rb +8 -0
- data/lib/rusic/cli.rb +19 -0
- data/lib/rusic/generators.rb +51 -0
- data/lib/rusic/idea.rb +8 -0
- data/lib/rusic/server.rb +33 -0
- data/lib/rusic/templates/ideas/edit.html.liquid +0 -0
- data/lib/rusic/templates/ideas/index.html.liquid +17 -0
- data/lib/rusic/templates/ideas/new.html.liquid +0 -0
- data/lib/rusic/templates/ideas/show.html.liquid +0 -0
- data/lib/rusic/templates/layouts/subdomain.html.liquid +51 -0
- data/lib/rusic/templates/rusic.yml +6 -0
- data/lib/rusic/version.rb +3 -0
- data/rusic.gemspec +28 -0
- data/spec/rusic_spec.rb +21 -0
- metadata +182 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.2@rusic-gem --create
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
rusic
|
2
|
+
=====
|
3
|
+
|
4
|
+
This gem makes it easy to develop themes for rusic.com. It can generate
|
5
|
+
themes, as well as serve them from a local server.
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
You'll need ruby, if you're on OS X you'll already have it. Then you'll
|
10
|
+
need to install the gem.
|
11
|
+
|
12
|
+
gem install rusic
|
13
|
+
|
14
|
+
If this gives you a permission error you might need to use `sudo`.
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
With the gem installed you can now generate a theme using the rusic
|
19
|
+
command line tool.
|
20
|
+
|
21
|
+
cd ~/Desktop # Or somewhere else maybe
|
22
|
+
rusic new example-theme
|
23
|
+
|
24
|
+
cd example-theme
|
25
|
+
rusic start
|
26
|
+
|
27
|
+
This will start up a server at http://localhost:4567/.
|
28
|
+
|
29
|
+
### Management
|
30
|
+
|
31
|
+
To simulate the different states the bucket can be in you can, for the
|
32
|
+
most part, use the web interface. However some things require custom
|
33
|
+
settings, for this you can use the `rusic set` command.
|
34
|
+
|
35
|
+
#### Bucket expires
|
36
|
+
|
37
|
+
To set an expiry date on the bucket, use the following command:
|
38
|
+
|
39
|
+
rusic set expires "in 3 hours"
|
40
|
+
|
41
|
+
#### Bucket name
|
42
|
+
|
43
|
+
rusic set name "My bucket"
|
44
|
+
|
45
|
+
## Features
|
46
|
+
|
47
|
+
* Super long urls
|
48
|
+
* Wide range of markdown examples
|
49
|
+
* Ideas, comments and likes in different states
|
50
|
+
* Toggle the timer for the bucket
|
51
|
+
* Simulate log in and out
|
52
|
+
* Flash messages
|
53
|
+
* Custom fields
|
54
|
+
|
55
|
+
## Publishing themes
|
56
|
+
|
57
|
+
Once you're happy with your theme, you'll want to publish it to your
|
58
|
+
rusic bucket. This can also be done with the `rusic(1)` cli tool.
|
59
|
+
|
60
|
+
The static assets will be shipped off to s3 for you, and the templates
|
61
|
+
will be uploaded using the API.
|
62
|
+
|
63
|
+
MIT Licenced
|
64
|
+
|
65
|
+
Copyright (c) 2011, Chris Mytton / Simpleweb
|
data/Rakefile
ADDED
data/bin/rusic
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Feature: Rusic
|
2
|
+
In order to create themes for rusic.com
|
3
|
+
As a designer/developer
|
4
|
+
I want to be able to generate themes from the cli
|
5
|
+
|
6
|
+
Scenario: New project
|
7
|
+
When I run `rusic new example`
|
8
|
+
Then the following files should exist:
|
9
|
+
| example/rusic.yml |
|
10
|
+
| example/layouts/subdomain.html.liquid |
|
11
|
+
| example/ideas/index.html.liquid |
|
12
|
+
| example/ideas/new.html.liquid |
|
13
|
+
| example/ideas/show.html.liquid |
|
14
|
+
| example/ideas/edit.html.liquid |
|
15
|
+
And the file "example/layouts/subdomain.html.liquid" should contain "{{yield}}"
|
16
|
+
And the file "example/ideas/index.html.liquid" should contain "rusic.ideas"
|
data/lib/rusic.rb
ADDED
data/lib/rusic/cli.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "thin"
|
3
|
+
require "rack/handler/thin"
|
4
|
+
|
5
|
+
require "rusic"
|
6
|
+
|
7
|
+
module Rusic
|
8
|
+
class CLI < Thor
|
9
|
+
desc "new NAME", "Create a new rusic theme"
|
10
|
+
def new(name)
|
11
|
+
Rusic::Generators::New.start([name])
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "server", "Start up a template server"
|
15
|
+
def server
|
16
|
+
Rack::Handler::Thin.run(Rusic::Server)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
module Rusic
|
4
|
+
module Generators
|
5
|
+
class New < Thor::Group
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
argument :name, :type => :string
|
9
|
+
|
10
|
+
def self.source_root
|
11
|
+
File.dirname(__FILE__)
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_project
|
15
|
+
empty_directory(name)
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_rusic_yml
|
19
|
+
template('templates/rusic.yml', "#{name}/rusic.yml")
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_layout_directory
|
23
|
+
empty_directory("#{name}/layouts")
|
24
|
+
end
|
25
|
+
|
26
|
+
def copy_layout
|
27
|
+
template('templates/layouts/subdomain.html.liquid', "#{name}/layouts/subdomain.html.liquid")
|
28
|
+
end
|
29
|
+
|
30
|
+
def create_ideas_directory
|
31
|
+
empty_directory("#{name}/ideas")
|
32
|
+
end
|
33
|
+
|
34
|
+
def copy_ideas_index
|
35
|
+
template('templates/ideas/index.html.liquid', "#{name}/ideas/index.html.liquid")
|
36
|
+
end
|
37
|
+
|
38
|
+
def copy_ideas_new
|
39
|
+
template('templates/ideas/new.html.liquid', "#{name}/ideas/new.html.liquid")
|
40
|
+
end
|
41
|
+
|
42
|
+
def copy_ideas_show
|
43
|
+
template('templates/ideas/show.html.liquid', "#{name}/ideas/show.html.liquid")
|
44
|
+
end
|
45
|
+
|
46
|
+
def copy_ideas_edit
|
47
|
+
template('templates/ideas/edit.html.liquid', "#{name}/ideas/edit.html.liquid")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/rusic/idea.rb
ADDED
data/lib/rusic/server.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'liquid'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module Rusic
|
6
|
+
class Server < Sinatra::Base
|
7
|
+
|
8
|
+
set :views, Dir.pwd
|
9
|
+
|
10
|
+
set :public, Dir.pwd + '/public'
|
11
|
+
|
12
|
+
enable :logging
|
13
|
+
|
14
|
+
helpers do
|
15
|
+
def bucket
|
16
|
+
bucket = YAML.load_file('rusic.yml')['bucket']
|
17
|
+
bucket['ideas'].map! { |i| Idea.new(i) }
|
18
|
+
bucket
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
get '/' do
|
23
|
+
liquid :"ideas/index.html", :layout => :"layouts/subdomain.html", :locals => { :rusic => bucket }
|
24
|
+
end
|
25
|
+
|
26
|
+
get '/ideas/:id' do
|
27
|
+
liquid :"ideas/show.html", :layout => :"layouts/subdomain.html", :locals => {
|
28
|
+
:rusic => bucket,
|
29
|
+
:idea => bucket['ideas'].select { |i| i['id'] == params[:id] }
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<ol id="ideas">
|
2
|
+
{% for idea in rusic.ideas %}
|
3
|
+
<li class="idea" id="idea-{{idea.id}}">
|
4
|
+
|
5
|
+
<h2>{{idea.title}}</h2>
|
6
|
+
|
7
|
+
<div class="meta">
|
8
|
+
<span class="date created">{{idea.created_at}}</span>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="content markdown">
|
12
|
+
{{markdown idea.content}}
|
13
|
+
</div>
|
14
|
+
|
15
|
+
</li>
|
16
|
+
{% endfor %}
|
17
|
+
</ol>
|
File without changes
|
File without changes
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
|
3
|
+
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
|
4
|
+
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
|
5
|
+
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
6
|
+
<head>
|
7
|
+
<meta charset="utf-8">
|
8
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
9
|
+
|
10
|
+
<title></title>
|
11
|
+
<meta name="description" content="">
|
12
|
+
<meta name="author" content="">
|
13
|
+
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
15
|
+
|
16
|
+
{{ # This will include all stylesheets in `assets/stylesheets` }}
|
17
|
+
{{include_stylesheets}}
|
18
|
+
|
19
|
+
<script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js"></script>
|
20
|
+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
|
21
|
+
{{ # This will include all javascripts in `assets/javascripts` }}
|
22
|
+
{{include_javascripts}}
|
23
|
+
|
24
|
+
</head>
|
25
|
+
|
26
|
+
<body>
|
27
|
+
|
28
|
+
<div id="container">
|
29
|
+
<header>
|
30
|
+
|
31
|
+
</header>
|
32
|
+
<div id="main" role="main">
|
33
|
+
|
34
|
+
{{ # This will be replace with the template content }}
|
35
|
+
{{yield}}
|
36
|
+
|
37
|
+
</div>
|
38
|
+
<footer>
|
39
|
+
|
40
|
+
</footer>
|
41
|
+
</div> <!-- eo #container -->
|
42
|
+
|
43
|
+
<script>
|
44
|
+
var _gaq=[["_setAccount","UA-XXXXX-X"],["_trackPageview"]]; // Change UA-XXXXX-X to be your site's ID
|
45
|
+
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
|
46
|
+
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
|
47
|
+
s.parentNode.insertBefore(g,s)}(document,"script"));
|
48
|
+
</script>
|
49
|
+
|
50
|
+
</body>
|
51
|
+
</html>
|
data/rusic.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/rusic/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Chris Mytton"]
|
6
|
+
gem.email = ["self@hecticjeff.net"]
|
7
|
+
gem.description = %q{Theming tool for rusic.com}
|
8
|
+
gem.summary = %q{Generate and manage themes for rusic.com, provides a local environment for rapid development}
|
9
|
+
gem.homepage = 'http://hq.rusic.com/theming'
|
10
|
+
|
11
|
+
gem.add_dependency 'thor', '~> 0.14.6'
|
12
|
+
gem.add_dependency 'sinatra', '~> 1.1.4'
|
13
|
+
gem.add_dependency 'thin', '~> 1.2.11'
|
14
|
+
gem.add_dependency 'liquid', '~> 2.2.2'
|
15
|
+
|
16
|
+
gem.add_development_dependency 'rake', '~> 0.9.0'
|
17
|
+
gem.add_development_dependency 'rspec', '~> 2.6.0'
|
18
|
+
gem.add_development_dependency 'rack-test', '~> 0.6'
|
19
|
+
gem.add_development_dependency 'cucumber', '~> 1.0'
|
20
|
+
gem.add_development_dependency 'aruba', '~> 0.4.3'
|
21
|
+
|
22
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
+
gem.files = `git ls-files`.split("\n")
|
24
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
+
gem.name = "rusic"
|
26
|
+
gem.require_paths = ['lib']
|
27
|
+
gem.version = Rusic::VERSION
|
28
|
+
end
|
data/spec/rusic_spec.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rusic'
|
2
|
+
require 'rack/test'
|
3
|
+
|
4
|
+
describe Rusic::VERSION do
|
5
|
+
it { should match(/\d\.\d\.\d/) }
|
6
|
+
end
|
7
|
+
|
8
|
+
describe Rusic::Server do
|
9
|
+
include Rack::Test::Methods
|
10
|
+
|
11
|
+
def app
|
12
|
+
Rusic::Server
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "GET /" do
|
16
|
+
# it "should be successful" do
|
17
|
+
# get '/'
|
18
|
+
# last_response.status.should be(200)
|
19
|
+
# end
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rusic
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Mytton
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-08-09 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: thor
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.14.6
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: sinatra
|
28
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.1.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: thin
|
39
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.2.11
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: liquid
|
50
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 2.2.2
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *id004
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: rake
|
61
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.9.0
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *id005
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.6.0
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *id006
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rack-test
|
83
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: "0.6"
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *id007
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: cucumber
|
94
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: "1.0"
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *id008
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: aruba
|
105
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.4.3
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *id009
|
114
|
+
description: Theming tool for rusic.com
|
115
|
+
email:
|
116
|
+
- self@hecticjeff.net
|
117
|
+
executables:
|
118
|
+
- rusic
|
119
|
+
extensions: []
|
120
|
+
|
121
|
+
extra_rdoc_files: []
|
122
|
+
|
123
|
+
files:
|
124
|
+
- .gitignore
|
125
|
+
- .rvmrc
|
126
|
+
- Gemfile
|
127
|
+
- README.md
|
128
|
+
- Rakefile
|
129
|
+
- bin/rusic
|
130
|
+
- features/rusic.feature
|
131
|
+
- features/support/env.rb
|
132
|
+
- lib/rusic.rb
|
133
|
+
- lib/rusic/cli.rb
|
134
|
+
- lib/rusic/generators.rb
|
135
|
+
- lib/rusic/idea.rb
|
136
|
+
- lib/rusic/server.rb
|
137
|
+
- lib/rusic/templates/ideas/edit.html.liquid
|
138
|
+
- lib/rusic/templates/ideas/index.html.liquid
|
139
|
+
- lib/rusic/templates/ideas/new.html.liquid
|
140
|
+
- lib/rusic/templates/ideas/show.html.liquid
|
141
|
+
- lib/rusic/templates/layouts/subdomain.html.liquid
|
142
|
+
- lib/rusic/templates/rusic.yml
|
143
|
+
- lib/rusic/version.rb
|
144
|
+
- rusic.gemspec
|
145
|
+
- spec/rusic_spec.rb
|
146
|
+
homepage: http://hq.rusic.com/theming
|
147
|
+
licenses: []
|
148
|
+
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
|
152
|
+
require_paths:
|
153
|
+
- lib
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
none: false
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
hash: 1851497966701980921
|
160
|
+
segments:
|
161
|
+
- 0
|
162
|
+
version: "0"
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
+
none: false
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
hash: 1851497966701980921
|
169
|
+
segments:
|
170
|
+
- 0
|
171
|
+
version: "0"
|
172
|
+
requirements: []
|
173
|
+
|
174
|
+
rubyforge_project:
|
175
|
+
rubygems_version: 1.8.5
|
176
|
+
signing_key:
|
177
|
+
specification_version: 3
|
178
|
+
summary: Generate and manage themes for rusic.com, provides a local environment for rapid development
|
179
|
+
test_files:
|
180
|
+
- features/rusic.feature
|
181
|
+
- features/support/env.rb
|
182
|
+
- spec/rusic_spec.rb
|