ninjs 0.12.3 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -9,8 +9,9 @@ h2. Installation
9
9
  You can install Ninjs using RubyGems. This is the easiest way of installing and recommended for most users.
10
10
  <pre name="code" class="brush: sh;">$ gem install ninjs</pre>
11
11
 
12
- If you want to use the development code you should clone the Git repository and add the binary to your path:
13
- <pre name="code" class="brush: sh">$ git clone git://github.com/textnotspeech/ninjs.git
12
+ For development you should clone the Git repository and add the application to your path:
13
+ <pre name="code" class="brush: sh">
14
+ $ git clone git://github.com/textnotspeech/ninjs.git
14
15
  $ export PATH=/path/to/ninjs/bin:$PATH
15
16
  </pre>
16
17
 
@@ -22,6 +23,13 @@ This will create a Ninjs application in the current working directory. Now we ca
22
23
 
23
24
  h1. Create a Ninjs module
24
25
 
26
+ Using the generate command we can create a module stub. The generate command takes two argument, the first is the type of file you'd like to generate and the second is the name of the file/module.
27
+
28
+ <pre name="code" class="brush: sh;">
29
+ $ ninjs generate module mymodule
30
+ // creates /modules/mymodule.module.js
31
+ </pre>
32
+
25
33
  Create a module file in the /modules directory. By convention, we'll name the file with a suffix of .module. An example of a module named hello would look like this:
26
34
 
27
35
  /modules/hello.module.js
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.3
1
+ 0.13.0
data/bin/ninjs CHANGED
@@ -16,14 +16,13 @@ class NinjsConsole < Rubikon::Application::Base
16
16
  @directory = '/'
17
17
  end
18
18
 
19
+ flag :v => :version
19
20
  option :version
20
- option :v => :version
21
21
  default do
22
22
  if version.given?
23
23
  time = Time.now
24
- copyright_year = time.year == 2010 ? '2010' : '2010-' << time.year
25
24
  Ninjs::Notification.notice 'ninjs ' + Ninjs::VERSION
26
- Ninjs::Notification.notice "Copyright (c) #{copyright_year} Dayton Nolan"
25
+ Ninjs::Notification.notice "Copyright (c) #{time.year} Dayton Nolan"
27
26
  Ninjs::Notification.notice "Released under the MIT License"
28
27
  else
29
28
  Ninjs::Command.help
@@ -42,11 +41,8 @@ class NinjsConsole < Rubikon::Application::Base
42
41
  Ninjs::Command.import
43
42
  end
44
43
 
45
- option :withdir, :path
46
- flag :p => :withdir
47
- command :create, :app_name do
48
- directory = (given? :p) ? withdir.path : false
49
- Ninjs::Command.create(app_name, directory)
44
+ command :create, :app_name, :dir => :optional do
45
+ dir.nil? ? Ninjs::Command.create(app_name) : Ninjs::Command.create(app_name, dir)
50
46
  end
51
47
 
52
48
  option :e
data/lib/ninjs.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Ninjs
2
- VERSION = '0.11.0'
3
2
  BASE_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
4
3
  LIB_DIR = File.expand_path(File.join(File.dirname(__FILE__)))
5
4
  ROOT_DIR = Dir.getwd
5
+ VERSION = File.open("#{BASE_DIR}/VERSION").readlines.join("")
6
6
  end
7
7
 
8
8
  %w(dependencies configuration helpers manifest project notification generator command).each do |lib|
data/lib/ninjs/command.rb CHANGED
@@ -61,25 +61,58 @@ module Ninjs
61
61
 
62
62
  def help
63
63
  puts <<-DOC
64
- --dev
64
+ ninjs #{Ninjs::VERSION}
65
+ Copyright (c) #{Time.new.year} Dayton Nolan
66
+ Released under the MIT License
67
+
65
68
  Description:
66
- The ninjs command line tool will compile your ninjs application into modules.
67
- To compile your ninjs application into module files:
69
+ The ninjs command line application is a simple way to quickly develop and manage your application. With it you can create an application, generate scaffolding, compile, and upgrade your application.
68
70
 
69
- Usage: ninjs [action] [options]
70
-
71
- Actions:
72
- compile Compiles the ninjs project in the current working directory
73
- watch Watches the current working directory for
74
- file changes and compiles when files change
75
- create Generates ninjs application architecture and files
76
- Options:
77
- -p, --directory Optional install directory for a new ninjs project
78
- (creates the folder if it does not exist)
71
+ Usage: ninjs [command] [arguments]
79
72
 
80
- Example:
81
- ninjs create MyApplication
82
- ninjs watch
73
+ Commands:
74
+ create Creates a new ninjs application in the current working
75
+ directory or sub directory within.
76
+
77
+ Arguments:
78
+ application name - Name of the ninjs application
79
+ sub directory* - Directory where the application will be
80
+ installed (created if non existent)
81
+
82
+ examples:
83
+ ninjs create myapp
84
+ ninjs create myapp subdirectory
85
+
86
+ generate Generates scoffolding for the given component file type.
87
+
88
+ Arguments:
89
+ file type - Type of application file to create (module, elements,
90
+ model).
91
+ module name* - Name of the module to generate the scaffold for
92
+
93
+ Flags:
94
+ -e - Generate an elements file for the same module
95
+ -m - Generate a model file for the same module
96
+
97
+ examples:
98
+ ninjs generate model mymodule -e -m
99
+ ninjs generate elements mymodule
100
+ ninjs generate model mymodule
101
+
102
+ compile Compiles the ninjs project in the current working directory.
103
+
104
+ example:
105
+ ninjs compile
106
+
107
+ watch Watches the current working directory for file changes and
108
+ compiles when changes are detected.
109
+
110
+ example:
111
+ ninjs watch
112
+
113
+ upgrade Upgrades your application's core files to the latest version.
114
+
115
+ * optional argument
83
116
  DOC
84
117
  end
85
118
 
@@ -53,7 +53,7 @@ module Ninjs
53
53
  conf_file << conf_content(@defaults)
54
54
  end
55
55
 
56
- Ninjs::Notification.notice "ninjs.conf created"
56
+ Ninjs::Notification.notify "ninjs.conf created", :added
57
57
  end
58
58
 
59
59
  def update
@@ -5,7 +5,7 @@ module Ninjs
5
5
  :none => "",
6
6
  :log => "\e[32m>>>\e[0m ",
7
7
  :event => "\e[33m<<<\e[0m ",
8
- :added => "\e[33m+++\e[0m ",
8
+ :added => "\e[32m+++\e[0m ",
9
9
  :error => "\e[0;31m!!!\e[0m "
10
10
  }
11
11
 
data/lib/ninjs/project.rb CHANGED
@@ -23,7 +23,6 @@ module Ninjs
23
23
  def create
24
24
  Ninjs::Notification.notice "Creating the #{@config.name} project in #{@project_path}"
25
25
  create_project_structure
26
- Ninjs::Notification.notice "created the project structure"
27
26
  @config.create
28
27
  create_ninjs_lib_file
29
28
  create_utility_lib_file
data/ninjs.conf CHANGED
@@ -1,7 +1,6 @@
1
- name: MyApplication
2
- asset_root: ../
1
+ name: test
3
2
  output: expanded
4
- dependencies: [<jquery/latest>]
5
- autoload: [<ninjs/utilities/all>]
3
+ dependencies: ["<jquery/latest>"]
4
+ autoload: ["<ninjs/utilities/all>"]
6
5
  base_url: http://www.example.com/
7
6
  test_path: tests/
data/ninjs.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ninjs}
8
- s.version = "0.12.3"
8
+ s.version = "0.13.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dayton Nolan"]
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 12
8
- - 3
9
- version: 0.12.3
7
+ - 13
8
+ - 0
9
+ version: 0.13.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dayton Nolan
@@ -529,7 +529,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
529
529
  requirements:
530
530
  - - ">="
531
531
  - !ruby/object:Gem::Version
532
- hash: 3604755208910180537
532
+ hash: 1429544377891496069
533
533
  segments:
534
534
  - 0
535
535
  version: "0"