ninjs 0.12.3 → 0.13.0
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.
- data/README.textile +10 -2
- data/VERSION +1 -1
- data/bin/ninjs +4 -8
- data/lib/ninjs.rb +1 -1
- data/lib/ninjs/command.rb +49 -16
- data/lib/ninjs/configuration.rb +1 -1
- data/lib/ninjs/notification.rb +1 -1
- data/lib/ninjs/project.rb +0 -1
- data/ninjs.conf +3 -4
- data/ninjs.gemspec +1 -1
- metadata +4 -4
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
|
-
|
13
|
-
<pre name="code" class="brush: sh"
|
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.
|
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) #{
|
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
|
-
|
46
|
-
|
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
|
-
|
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
|
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 [
|
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
|
-
|
81
|
-
ninjs
|
82
|
-
|
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
|
|
data/lib/ninjs/configuration.rb
CHANGED
data/lib/ninjs/notification.rb
CHANGED
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:
|
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
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
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:
|
532
|
+
hash: 1429544377891496069
|
533
533
|
segments:
|
534
534
|
- 0
|
535
535
|
version: "0"
|