tonic 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tonic (0.0.1)
4
+ tonic (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -1,35 +1,33 @@
1
- # Tonic gem — add some tonus for your development :)
1
+ # Tonic gem — add some tonus for development your gh-pages :)
2
2
 
3
3
  ### This is beta now
4
4
 
5
5
  ### Build Status ![http://travis-ci.org/gazay/gon](https://secure.travis-ci.org/gazay/tonic.png)
6
6
 
7
- If you want to create your simple static application,
8
- and want to use for that sass-compass/haml/coffee/something
9
- THIS GEM FOR YOU
7
+ This gem supports [middleman](https://github.com/middleman/middleman)
8
+ and will support in near future [jekyll](https://github.com/mojombo/jekyll) for generate template of your site.
10
9
 
11
10
  If you want to easily create custom gh-pages for your application,
12
11
  and again - want to use for that the same technologies
12
+
13
13
  THIS GEM TOTALY FOR YOU
14
14
 
15
+ If you want to create your simple static application,
16
+ and want to use for that sass-compass/haml/coffee/something
17
+
18
+ THIS GEM FOR YOU
19
+
15
20
  ## Why?
16
21
 
17
22
  Because make html as html is too mainstream. Now you should know all
18
23
  benefits of using haml, coffee and sass. And of course other template engines for
19
24
  other or the same purposes. You should know and I think you love it.
20
25
 
21
- And what will you do if you need to create simple, one-page application?
22
- With static html, with not too big js and styles?
23
- Maybe I don't know something, but you sigh maybe about your
24
- lovely haml/sass/coffee and go to do all this stuff like in nineteens.
25
-
26
- Because for one single page you will not to run compass, compile each coffeescript and haml file.
27
- You just sit and write pure html/css/js.
28
-
29
- So I thought about it a little and made this gem.
26
+ There a lot of cool static site generators, from jekyll to this one :)
27
+ But no one give to you so simple ui (maybe middleman, but tonic knows how to do gh-pages branch right;)
30
28
 
31
- Ar first it was gem just for create gh-pages branch with some content (because I'm too lazy sometimes).
32
- But then I decided to do more - and now it will do all stuff for you. You just need write some nice code :)
29
+ You can choose with what template you want to develop your site:
30
+ tonic, middleman or jekyll (jekyll support not yet ready)
33
31
 
34
32
 
35
33
  ## How?
@@ -39,15 +37,48 @@ This gem have two functions inside:
39
37
  1. tonic-template
40
38
  2. tonic for gh-pages
41
39
 
42
- Tonic-template more important here, because it is that thing for easy developing!
40
+ Tonic-template it is that thing for easy developing.
43
41
  Tonic-template uses for it's work several gems, like template engines, rake and sprockets.
44
42
  Sprockets make this template look like rails assets folder.
45
43
 
46
44
  You don't need every time run some command in terminal or push somewhere.
47
45
  You need just write `rake watch`
48
46
 
49
- Tonic for gh-pages is simplier, because it uses only ruby-lang libraries like open3 and pathname,
50
- and it's general purpose - is create new branch `gh-pages`, copy there tonic-template and run bundler.
47
+ Tonic for gh-pages is simplier, because it uses only ruby-lang libraries like open3 and pathname and dependent on jekyll and middleman,
48
+ and it's general purpose - is create new branch `gh-pages`, init there choosen template and run bundler if it's needed.
49
+
50
+ ### Using tonic for gh-pages
51
+
52
+ You should be in your repo, for which you want to create gh-pages.
53
+ You shouldn't have in this repo this branch already.
54
+ So you just run:
55
+
56
+ ```bash
57
+ $ gem install tonic
58
+ $ tonic [middleman|jekyll]
59
+ ```
60
+
61
+ It will ask you - do you really want blahblahblah. You say `y` and there is it!
62
+ Will be created branch gh-pages, then tonic checkout you there and remove from there all (not dot-) files.
63
+ Then it will copy choosen template to this branch and run bundle install if it's needed.
64
+
65
+ And you can work with this template.
66
+
67
+ When you want to push your gh-pages branch to github, just write:
68
+
69
+ ```bash
70
+ $ tonic push
71
+ ```
72
+
73
+ Or oldschool:
74
+
75
+ ```bash
76
+ $ git push -f origin gh-pages
77
+ ```
78
+
79
+ Example you can see on [gh-pages for tonic](http://gazay.github.com/tonic)
80
+
81
+ And what inside template in [gh-pages branch](https://github.com/gazay/tonic/tree/gh-pages)
51
82
 
52
83
  ### Using tonic-template
53
84
 
@@ -74,37 +105,26 @@ Then you can do two things:
74
105
  bundle exec rake watch
75
106
  ```
76
107
 
77
- Later I will add comands with tonic, but now I tired :)
78
- And I want to add comands to open needed files from terminal.
79
-
80
- ### Using tonic for gh-pages
81
-
82
- You should be in your repo, for which you want to create gh-pages.
83
- You shouldn't have in this repo this branch already.
84
- So you just run:
85
-
86
- ```bash
87
- $ gem install tonic
88
- $ tonic
89
- ```
90
-
91
- It will ask you - do you really want blahblahblah. You say `y` and there is it!
92
- Will be created branch gh-pages, then you checkout there and remove from there all files.
93
- Then tonic will copy tonic-template to this branch and run bundle install.
94
-
95
- Then you just work with this template like with ordinary tonic-template.
96
-
97
108
  ## What?
98
109
 
99
- In template used next gems for make it work:
110
+ In tonic used next gems for make it work:
100
111
 
101
112
  [rake](https://github.com/jimweirich/rake)
113
+
102
114
  [bundler](https://github.com/carlhuda/bundler)
115
+
103
116
  [uglifier](https://github.com/lautis/uglifier)
117
+
104
118
  [sprockets](https://github.com/sstephenson/sprockets)
119
+
105
120
  [haml](https://github.com/nex3/haml)
121
+
106
122
  [compass](https://github.com/chriseppstein/compass)
107
123
 
124
+ [middleman](https://github.com/middleman/middleman)
125
+
126
+ [jekyll](https://github.com/mojombo/jekyll)
127
+
108
128
  Lot of code for rakefile of template and for octocat in test page
109
129
  I get from one-page project of my friend @ai [easings.net](https://github.com/ai/easings.net)
110
130
 
@@ -13,12 +13,12 @@ module Tonic
13
13
  private
14
14
 
15
15
  def deal_with_args(args)
16
- if args.empty?
17
- Tonic::GhPages.activate
16
+ if want_to_push?(args)
17
+ Tonic::GhPages.push_pages
18
+ elsif want_gh_pages?
19
+ Tonic::GhPages.activate(args[0])
18
20
  elsif want_to_create?(args)
19
21
  Tonic::Template.create args[1]
20
- elsif want_to_push?(args)
21
- Tonic::GhPages.push_pages
22
22
  else
23
23
  raise ArgumentError.new 'Strange argument you sent to tonic'
24
24
  end
@@ -32,5 +32,9 @@ module Tonic
32
32
  args[0] == 'push'
33
33
  end
34
34
 
35
+ def wand_gh_pages?
36
+ args.empty? or %w(middleman jekyll).include?(args[0])
37
+ end
38
+
35
39
  end
36
40
  end
@@ -2,8 +2,8 @@ module Tonic
2
2
  module GhPages
3
3
  class << self
4
4
 
5
- def activate
6
- gh_pages
5
+ def activate(template = nil)
6
+ gh_pages(template)
7
7
  end
8
8
 
9
9
  def push_pages
@@ -21,7 +21,9 @@ module Tonic
21
21
  branches.lines.any? { |it| it =~ /\* gh-pages/ }
22
22
  end
23
23
 
24
- def gh_pages
24
+ def gh_pages(template = nil)
25
+ are_you_in_repo?
26
+
25
27
  if branch_exists?
26
28
  abort 'You shall no pass. First you should delete gh-pages branch'
27
29
  end
@@ -31,11 +33,30 @@ module Tonic
31
33
  check_status
32
34
  create_branch
33
35
  remove_all_files
34
- Template.create
36
+ create template
35
37
  commit_changes
36
38
  end
37
39
  end
38
40
 
41
+ def create(template = nil)
42
+ case template
43
+ when 'middleman'
44
+ sh 'middleman init ./'
45
+ when 'jekyll'
46
+ puts 'I will add integration with Jekyll later, now I will install tonic-template'
47
+ Template.create
48
+ else
49
+ Template.create
50
+ end
51
+ end
52
+
53
+ def are_you_in_repo?
54
+ check = sh('git status').to_s
55
+ if check =~ /Not a git repository/
56
+ abort "You are not in git repo. If you want to create tonic-template write `tonic new my_app`"
57
+ end
58
+ end
59
+
39
60
  def branch_exists?
40
61
  branches = sh('git branch')
41
62
  branches.lines.any? { |it| it =~ /gh-pages/ }
@@ -1,5 +1,5 @@
1
1
  module Tonic
2
2
 
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
 
5
5
  end
@@ -0,0 +1,19 @@
1
+ require 'tonic'
2
+
3
+ describe Tonic do
4
+ context 'Tonic will' do
5
+
6
+ before :all do
7
+ system 'cd spec/dummy_git_repo'
8
+ end
9
+
10
+ it "" do
11
+ Tonic.activate([]).should =~ /not in root of your repo/
12
+ end
13
+
14
+ after :all do
15
+ system 'cd ...'
16
+ end
17
+
18
+ end
19
+ end
@@ -58,6 +58,7 @@ a
58
58
  line-height: 1.1
59
59
  code
60
60
  font-size: 10px
61
+ font-family: "PT Mono", monospace
61
62
  .source-crop
62
63
  position: absolute
63
64
  width: 120px
@@ -4,7 +4,7 @@
4
4
  %h1
5
5
  %a( href='https://github.com/gazay/tonic' ) This is tonic gem gh-page
6
6
 
7
- %h2 Which was made with tonic-template: sass(with compass)/haml/coffee.
7
+ %h2 Which was made with tonic-template: sass/compass/haml/coffee.
8
8
 
9
9
  .tonic-logo
10
10
 
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.authors = ['gazay']
10
10
  s.email = ['alex.gaziev@gmail.com']
11
11
  s.homepage = "https://github.com/gazay/tonic"
12
- s.summary = %q{Create github pages easy with Sass, Haml/Slim, Coffee.}
12
+ s.summary = %q{Create one-page apps easy with Sass, Haml/Compass, Coffee.}
13
13
  s.description = %q{You don't need to write your github pages in html and css anymore - now it's simple to use your favorite technologies with tonic!}
14
14
 
15
15
  s.rubyforge_project = "tonic"
@@ -19,6 +19,9 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib", "bin"]
21
21
 
22
+ s.add_dependency "middleman"
23
+ s.add_dependency "jekyll"
24
+
22
25
  s.add_development_dependency "rspec"
23
26
  s.add_development_dependency "rake"
24
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tonic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,9 +11,31 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: middleman
16
+ requirement: &70281059243480 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70281059243480
25
+ - !ruby/object:Gem::Dependency
26
+ name: jekyll
27
+ requirement: &70281059241580 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70281059241580
14
36
  - !ruby/object:Gem::Dependency
15
37
  name: rspec
16
- requirement: &70292517141580 !ruby/object:Gem::Requirement
38
+ requirement: &70281059239400 !ruby/object:Gem::Requirement
17
39
  none: false
18
40
  requirements:
19
41
  - - ! '>='
@@ -21,10 +43,10 @@ dependencies:
21
43
  version: '0'
22
44
  type: :development
23
45
  prerelease: false
24
- version_requirements: *70292517141580
46
+ version_requirements: *70281059239400
25
47
  - !ruby/object:Gem::Dependency
26
48
  name: rake
27
- requirement: &70292517140780 !ruby/object:Gem::Requirement
49
+ requirement: &70281059238320 !ruby/object:Gem::Requirement
28
50
  none: false
29
51
  requirements:
30
52
  - - ! '>='
@@ -32,7 +54,7 @@ dependencies:
32
54
  version: '0'
33
55
  type: :development
34
56
  prerelease: false
35
- version_requirements: *70292517140780
57
+ version_requirements: *70281059238320
36
58
  description: You don't need to write your github pages in html and css anymore - now
37
59
  it's simple to use your favorite technologies with tonic!
38
60
  email:
@@ -69,7 +91,6 @@ files:
69
91
  - template/assets/sass/_base.sass
70
92
  - template/assets/sass/application.css.sass
71
93
  - template/assets/templates/index.html.haml
72
- - template/assets/templates/index.html.slim
73
94
  - template/assets/templates/layout/layout.html.haml
74
95
  - tonic.gemspec
75
96
  homepage: https://github.com/gazay/tonic
@@ -96,7 +117,7 @@ rubyforge_project: tonic
96
117
  rubygems_version: 1.8.17
97
118
  signing_key:
98
119
  specification_version: 3
99
- summary: Create github pages easy with Sass, Haml/Slim, Coffee.
120
+ summary: Create one-page apps easy with Sass, Haml/Compass, Coffee.
100
121
  test_files:
101
122
  - spec/tonic/fail_spec.rb
102
123
  - spec/tonic/tonic_spec.rb
File without changes