tau 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 38c4dff2363ca430cd01fca3bff75b5d3cebbb11
4
+ data.tar.gz: 6ab29e90496e18e8b035d0c0e1d0a51191b6e4e9
5
+ SHA512:
6
+ metadata.gz: e2882456f5986a5ea2ab5b8979739829fa61668b6c45065a9a54679271815f939641aa72e3740e3331489c410ae4ece9367e91f8175b67ce34d3db095347b685
7
+ data.tar.gz: 6188a8b0c7d8898cd9a406259f16e0867ec2ec354e411347c889021206f3abefe4017845d26a1a8b3e4ee41549575c536fde929d97624d9fab1865c6de4dafc0
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in tau.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'rake'
8
+ end
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Dmitry Zhlobo
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
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.
data/README.md CHANGED
@@ -1,93 +1,99 @@
1
- Tau
2
- ===
3
-
4
- Tau provides you write code of webpages using modern technologies such as
5
- haml, sass, coffee-script. You dont't need to compile your code to HTML and
6
- CSS by hand everytime you something change.
7
-
8
- Installation
9
- ------------
10
-
11
- gem install tau
12
-
13
- Usage
14
- -----
15
-
16
- It's pretty simple.
17
-
18
- ### Getting started
19
-
20
- 1. Start new coding project and switch to that. In the command prompt run:
21
-
22
- `tau new example.com; cd example.com` *(where example.com is the project name)*
23
-
24
- 2. Create html or haml file on code directory:
25
-
26
- `echo "%h1 Hello <strong>tau</strong>!" > code/hello.haml`
27
-
28
- 3. Start server and go to [http://localhost:15000/hello.html](http://localhost:15000/hello.html):
29
-
30
- `tau server`
31
-
32
- Attend even if you write hello.**haml** file you can see it by hello.**html**
33
- in browser.
34
-
35
- ### Creating new project
36
-
37
- Run `tau new projectname` and tau will make directory tree for you:
38
-
39
- projectname
40
- |--code - for your .html and .haml files
41
- | |--js - for .js and .coffee files
42
- | |--css - for .css, .sass and .scss
43
- | `--img - for any type of images
44
- |
45
- `--tau.yaml - config file
46
-
47
- ### Coding
48
-
49
- Run `tau server` in your project directory. Then put any html or haml files
50
- into **code** directory, js or coffee files into **code/js**, css, sass or
51
- scss into **code/css**. Now you can view files in browser by
52
- http://localhost:15000/page.html or http://localhost:15000/css/style.css or
53
- http://localhost:15000/js/script.js.
54
-
55
- Attend that tau changes files extensions in browser from haml to html, from
56
- coffee to js, from sass and scss to css. For example if you have
57
- **code/js/myscript.coffee** file you can see it in browser by
58
- http://localhost:15000/js/myscript.js.
59
-
60
- In html or haml file you can include scripts written in coffee and styles
61
- written in sass or scss. For example if you have **code/js/script.coffee**
62
- script and **code/js/style.sass** spreadsheet you can include it to html by
63
- lines:
64
- ```html
65
- <script src='js/script.js'></script>
66
- <link rel="stylesheet" href="css/style.css">
67
- ```
68
- Anytime you change any file you can see updated version in browser. You don't
69
- need to compile anything by hand.
70
-
71
- ### Building project
72
-
73
- If you want to compile all files for releasing it in internet you don't need do
74
- it by hand. `tau build` command compiles all sass, haml and other files and put
75
- them into **build/** directory. Any files from **img** directory and not a haml, sass
76
- or coffee-script files will copied without any changes. For example:
77
- ```
78
- code/index.haml -> build/index.html
79
- code/js/script.coffee -> build/js/script.js
80
- code/img/logo.png -> build/img/logo.png
81
- code/humans.txt -> build/humans.txt
82
- etc...
83
- ```
84
-
85
- License
86
- -------
87
-
88
- You can use tau by MIT License.
89
-
90
- Contributing
91
- ------------
92
-
93
- Feel free to fork and pull request.
1
+ Tau [![Build Status](https://secure.travis-ci.org/Proghat/tau.png?branch=master)](http://travis-ci.org/Proghat/tau) [![Gem Version](https://badge.fury.io/rb/tau.png)](http://badge.fury.io/rb/tau)
2
+ ===
3
+
4
+ Tau provides you write code of webpages using modern technologies such as
5
+ haml, sass, coffee-script. You dont't need to compile your code to HTML and
6
+ CSS by hand everytime you something change.
7
+
8
+ Requirements
9
+ ------------
10
+
11
+ You need ruby version **1.9.3** installed. See [rvm](https://rvm.io/).
12
+
13
+
14
+ Installation
15
+ ------------
16
+
17
+ gem install tau
18
+
19
+ Usage
20
+ -----
21
+
22
+ It's pretty simple.
23
+
24
+ ### Getting started
25
+
26
+ 1. Start new coding project and switch to that. In the command prompt run:
27
+
28
+ `tau new example.com; cd example.com` *(where example.com is the project name)*
29
+
30
+ 2. Create html or haml file on code directory:
31
+
32
+ `echo '%h1 Hello <strong>tau</strong>!' > code/hello.haml`
33
+
34
+ 3. Start server and go to [http://localhost:15000/hello.html](http://localhost:15000/hello.html):
35
+
36
+ `tau server`
37
+
38
+ Attend even if you write hello.**haml** file you can see it by hello.**html**
39
+ in browser.
40
+
41
+ ### Creating new project
42
+
43
+ Run `tau new projectname` and tau will make directory tree for you:
44
+
45
+ projectname
46
+ |--code - for your .html and .haml files
47
+ | |--js - for .js and .coffee files
48
+ | |--css - for .css, .sass and .scss
49
+ | `--img - for any type of images
50
+ |
51
+ `--tau.yaml - config file
52
+
53
+ ### Coding
54
+
55
+ Run `tau server` in your project directory. Then put any html or haml files
56
+ into **code** directory, js or coffee files into **code/js**, css, sass or
57
+ scss into **code/css**. Now you can view files in browser by
58
+ http://localhost:15000/page.html or http://localhost:15000/css/style.css or
59
+ http://localhost:15000/js/script.js.
60
+
61
+ Attend that tau changes files extensions in browser from haml to html, from
62
+ coffee to js, from sass and scss to css. For example if you have
63
+ **code/js/myscript.coffee** file you can see it in browser by
64
+ http://localhost:15000/js/myscript.js.
65
+
66
+ In html or haml file you can include scripts written in coffee and styles
67
+ written in sass or scss. For example if you have **code/js/script.coffee**
68
+ script and **code/js/style.sass** spreadsheet you can include it to html by
69
+ lines:
70
+ ```html
71
+ <script src='js/script.js'></script>
72
+ <link rel="stylesheet" href="css/style.css">
73
+ ```
74
+ Anytime you change any file you can see updated version in browser. You don't
75
+ need to compile anything by hand.
76
+
77
+ ### Building project
78
+
79
+ If you want to compile all files for releasing it in internet you don't need do
80
+ it by hand. `tau build` command compiles all sass, haml and other files and put
81
+ them into **build/** directory. Any files from **img** directory and not a haml, sass
82
+ or coffee-script files will copied without any changes. For example:
83
+ ```
84
+ code/index.haml -> build/index.html
85
+ code/js/script.coffee -> build/js/script.js
86
+ code/img/logo.png -> build/img/logo.png
87
+ code/humans.txt -> build/humans.txt
88
+ etc...
89
+ ```
90
+
91
+ License
92
+ -------
93
+
94
+ You can use tau by MIT License.
95
+
96
+ Contributing
97
+ ------------
98
+
99
+ Feel free to fork and pull request.
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
+ require "cucumber/rake/task"
3
+
4
+ Cucumber::Rake::Task.new(:test) do |t|
5
+ t.cucumber_opts = "features --format pretty"
6
+ end
7
+
8
+ task :default => :test
data/bin/tau CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'tau/cli'
3
3
 
4
- Tau::Cli.start
4
+ Tau::Cli.start
@@ -1,41 +1,41 @@
1
- Feature: Builder
2
- In order to avoid compiling all files by hand
3
- As a web developer
4
- I want tau compile all files for me
5
-
6
- Background: making project
7
- Given I successfully run `tau new project2build`
8
- And I cd to "project2build"
9
-
10
- Scenario: building project
11
- Given a file named "code/hamltest.haml" with:
12
- """
13
- %h1 Hello, world!
14
- %strong I'm tau ;)
15
- """
16
- And a file named "code/js/coffeetest.coffee" with:
17
- """
18
- square = (x) -> x * x
19
- cube = (x) -> square(x) * x
20
- """
21
- And a file named "code/css/sasstest.sass" with:
22
- """
23
- $blue: #3bbfce
24
- .content-navigation
25
- border-color: $blue
26
- color: darken($blue, 9%)
27
- """
28
- And a file named "code/css/scsstest.scss" with:
29
- """
30
- $blue: #3bbfce;
31
- .content-navigation {
32
- border-color: $blue;
33
- color:
34
- darken($blue, 9%);
35
- }
36
- """
37
- When I successfully run `tau build`
38
- Then I should see file "build/hamltest.html" compiled from haml in "code/hamltest.haml"
39
- And I should see file "build/js/coffeetest.js" compiled from coffee-script in "code/js/coffeetest.coffee"
40
- And I should see file "build/css/sasstest.css" compiled from sass in "code/css/sasstest.sass"
41
- And I should see file "build/css/scsstest.css" compiled from scss in "code/css/scsstest.scss"
1
+ Feature: Builder
2
+ In order to avoid compiling all files by hand
3
+ As a web developer
4
+ I want tau compile all files for me
5
+
6
+ Background: making project
7
+ Given I successfully run `tau new project2build`
8
+ And I cd to "project2build"
9
+
10
+ Scenario: building project
11
+ Given a file named "code/hamltest.haml" with:
12
+ """
13
+ %h1 Hello, world!
14
+ %strong I'm tau ;)
15
+ """
16
+ And a file named "code/js/coffeetest.coffee" with:
17
+ """
18
+ square = (x) -> x * x
19
+ cube = (x) -> square(x) * x
20
+ """
21
+ And a file named "code/css/sasstest.sass" with:
22
+ """
23
+ $blue: #3bbfce
24
+ .content-navigation
25
+ border-color: $blue
26
+ color: darken($blue, 9%)
27
+ """
28
+ And a file named "code/css/scsstest.scss" with:
29
+ """
30
+ $blue: #3bbfce;
31
+ .content-navigation {
32
+ border-color: $blue;
33
+ color:
34
+ darken($blue, 9%);
35
+ }
36
+ """
37
+ When I successfully run `tau build`
38
+ Then I should see file "build/hamltest.html" compiled from haml in "code/hamltest.haml"
39
+ And I should see file "build/js/coffeetest.js" compiled from coffee-script in "code/js/coffeetest.coffee"
40
+ And I should see file "build/css/sasstest.css" compiled from sass in "code/css/sasstest.sass"
41
+ And I should see file "build/css/scsstest.css" compiled from scss in "code/css/scsstest.scss"
@@ -1,20 +1,20 @@
1
- Feature: Making new projects
2
- In order to avoid making project directory myself
3
- As a web developer
4
- I want tau make project for me
5
-
6
- Scenario: making new project by tau
7
- When I successfully run `tau new test_project`
8
- Then there should be right project directory "test_project"
9
-
10
- Scenario: making project with dot in project name
11
- When I successfully run `tau new .test.project.`
12
- Then there should be right project directory ".test.project."
13
-
14
- Scenario: making project with cyrillic name
15
- When I successfully run `tau new тест`
16
- Then there should be right project directory "тест"
17
-
18
- Scenario: making project with "-" symbol in project name
19
- When I successfully run `tau new -test-project-`
20
- Then there should be right project directory "-test-project-"
1
+ Feature: Making new projects
2
+ In order to avoid making project directory myself
3
+ As a web developer
4
+ I want tau make project for me
5
+
6
+ Scenario: making new project by tau
7
+ When I successfully run `tau new test_project`
8
+ Then there should be right project directory "test_project"
9
+
10
+ Scenario: making project with dot in project name
11
+ When I successfully run `tau new .test.project.`
12
+ Then there should be right project directory ".test.project."
13
+
14
+ Scenario: making project with cyrillic name
15
+ When I successfully run `tau new тест`
16
+ Then there should be right project directory "тест"
17
+
18
+ Scenario: making project with "-" symbol in project name
19
+ When I successfully run `tau new -test-project-`
20
+ Then there should be right project directory "-test-project-"
@@ -1,20 +1,20 @@
1
- Then /^there should be right project directory "(.*)"$/ do |project_dir|
2
- tau_dirs = ['/code', 'code/js', 'code/css', 'code/img'].map { |dir| "#{project_dir}/#{dir}" }
3
- check_directory_presence(tau_dirs, true)
4
- tau_files = ['tau.yml'].map { |file| "#{project_dir}/#{file}" }
5
- check_file_presence(tau_files, true)
6
- end
7
-
8
- Then /^I should see file "(.*)" compiled from (haml|sass|scss|coffee-script) in "(.*)"$/ do |compiled_file, lang, src_file|
9
- compiled_file_content = nil
10
- src_file_content = nil
11
- in_current_dir do
12
- compiled_file_content = File.read compiled_file
13
- src_file_content = File.read src_file
14
- end
15
- compiled_file_content.should == render(src_file_content, lang)
16
- end
17
-
18
- Given /^I'm on sandbox project directory$/ do
19
- @dirs = [SANDBOX_PROJECT_DIR]
20
- end
1
+ Then /^there should be right project directory "(.*)"$/ do |project_dir|
2
+ tau_dirs = ['/code', 'code/js', 'code/css', 'code/img'].map { |dir| "#{project_dir}/#{dir}" }
3
+ check_directory_presence(tau_dirs, true)
4
+ tau_files = ['tau.yml'].map { |file| "#{project_dir}/#{file}" }
5
+ check_file_presence(tau_files, true)
6
+ end
7
+
8
+ Then /^I should see file "(.*)" compiled from (haml|sass|scss|coffee-script) in "(.*)"$/ do |compiled_file, lang, src_file|
9
+ compiled_file_content = nil
10
+ src_file_content = nil
11
+ in_current_dir do
12
+ compiled_file_content = File.read compiled_file
13
+ src_file_content = File.read src_file
14
+ end
15
+ compiled_file_content.should == render(src_file_content, lang)
16
+ end
17
+
18
+ Given /^I'm on sandbox project directory$/ do
19
+ @dirs = [SANDBOX_PROJECT_DIR]
20
+ end
@@ -1,4 +1,4 @@
1
- # Include useful steps.
1
+ # Include useful steps.
2
2
  # See full list at https://github.com/cucumber/aruba/blob/master/lib/aruba/cucumber.rb
3
3
  require 'aruba/cucumber'
4
4
 
@@ -6,6 +6,12 @@ require 'aruba/cucumber'
6
6
  # See https://github.com/cucumber/aruba/blob/master/lib/aruba/api.rb for more information
7
7
  require 'aruba/api'
8
8
 
9
+ # Prepare test environment.
10
+ # Build and intall our gem.
11
+ # `tau something` command will be executed in test environment.
12
+ require File.expand_path("#{File.dirname(__FILE__)}/cukegem.rb")
13
+ CukeGem.setup('tau.gemspec')
14
+
9
15
  # Making test project and start server on it
10
16
  require 'childprocess'
11
17
  FileUtils::mkdir_p('tmp/sandbox')
@@ -13,11 +19,11 @@ server_process = nil
13
19
  Dir.chdir('tmp/sandbox') do
14
20
  FileUtils::rm_rf('servertesting')
15
21
  # Create new project. TODO: think what if tau projecter not works correctly
16
- ChildProcess.build('tau new servertesting').start.wait
22
+ ChildProcess.build('tau', 'new', 'servertesting').start.wait
17
23
 
18
24
  # Run server on test project directory
19
25
  Dir.chdir('servertesting') do
20
- server_process = ChildProcess.build('tau server')
26
+ server_process = ChildProcess.build('tau', 'server')
21
27
  server_process.start
22
28
  end
23
29
  end
@@ -27,9 +33,3 @@ SANDBOX_PROJECT_DIR = File.expand_path('tmp/sandbox/servertesting')
27
33
  at_exit do
28
34
  server_process.stop
29
35
  end
30
-
31
- # Prepare test environment.
32
- # Build and intall our gem.
33
- # `tau something` command will be executed in test environment.
34
- require File.expand_path("#{File.dirname(__FILE__)}/cukegem.rb")
35
- CukeGem.setup('tau.gemspec')