erebus 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rst CHANGED
@@ -13,8 +13,29 @@ Install it yourself as:
13
13
  Usage
14
14
  -----------
15
15
 
16
- ..:: Todo: Write usage instructions here
16
+ To create a new C++ project:
17
17
 
18
+ erebos project NAME
19
+
20
+ To see a list of tasks erebus can do:
21
+
22
+ erebos
23
+
24
+ To create a header file:
25
+
26
+ erebos header NAME
27
+
28
+ To create a C++ source file:
29
+
30
+ erebos source NAME
31
+
32
+ To create a C source file:
33
+
34
+ erebos source NAME --ext c
35
+
36
+ To generate a C++ class:
37
+
38
+ erebos cpp_class NAME
18
39
 
19
40
  Contributing
20
41
  --------------
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["cajun.code@gmail.com"]
11
11
  gem.description = %q{C++ Project and File generators}
12
12
  gem.summary = %q{C++ Development can be a pain. Project setup is dependent on the tools used in the project and the developer. This tool is a command line tool for generating project and files independent of any ide or editor.}
13
- gem.homepage = ""
13
+ gem.homepage = "https://github.com/cajun-code/erebus"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,6 +1,11 @@
1
1
  require "thor"
2
2
 
3
3
  module Erebus
4
+
5
+ class ErebusError < StandardError
6
+ end
7
+
8
+
4
9
  class Generator < Thor::Group
5
10
  include Thor::Actions
6
11
 
@@ -15,8 +20,13 @@ module Erebus
15
20
  def user
16
21
  ENV["USER"]
17
22
  end
23
+
24
+ def self.validate_project
25
+ fail ErebusError.new "Please go inside the project directory to run this command" if !File.exists? ".erebus"
26
+ end
18
27
  end
19
28
 
29
+
20
30
  class NamedGenerator < Generator
21
31
  argument :name
22
32
 
@@ -3,6 +3,8 @@ require "erebus/generator"
3
3
  class CppClass < Erebus::NamedGenerator
4
4
  desc "Create a C/C++ Class"
5
5
 
6
+ #validate_project
7
+
6
8
  #class_option :ext,:type => :string ,:default => "cpp", :desc => "Extention used for the source file"
7
9
 
8
10
  def self.source_root
@@ -10,6 +12,7 @@ class CppClass < Erebus::NamedGenerator
10
12
  end
11
13
 
12
14
  def create_header_file
15
+ CppClass.validate_project
13
16
  template "templates/class.h.erb", "include/#{file_name}.h"
14
17
  end
15
18
  def create_source_file
@@ -5,11 +5,14 @@ class Header < Erebus::NamedGenerator
5
5
 
6
6
  class_option :ext,:type => :string ,:default => "h", :desc => "Extention used for the header"
7
7
 
8
+
9
+
8
10
  def self.source_root
9
11
  File.dirname(__FILE__)
10
12
  end
11
13
 
12
14
  def create_header_file
15
+ Header.validate_project
13
16
  template "templates/blank.erb", "include/#{file_name}.#{ext}"
14
17
  end
15
18
 
@@ -20,5 +20,9 @@ class Project < Erebus::NamedGenerator
20
20
  template "templates/main.cpp.erb", "#{class_name}/src/main.cpp"
21
21
  end
22
22
 
23
+ def create_erebus_file
24
+ template "templates/project.erebus.erb", "#{class_name}/.erebus"
25
+ end
26
+
23
27
  end
24
28
 
@@ -5,11 +5,14 @@ class Source < Erebus::NamedGenerator
5
5
 
6
6
  class_option :ext,:type => :string ,:default => "cpp", :desc => "Extention used for the source file"
7
7
 
8
+ #validate_project
9
+
8
10
  def self.source_root
9
11
  File.dirname(__FILE__)
10
12
  end
11
13
 
12
14
  def create_source_file
15
+ Source.validate_project
13
16
  template "templates/blank.erb", "src/#{file_name}.#{ext}"
14
17
  end
15
18
 
@@ -0,0 +1 @@
1
+ project: <%= class_name %>
@@ -1,3 +1,3 @@
1
1
  module Erebus
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erebus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -118,9 +118,10 @@ files:
118
118
  - lib/erebus/generators/templates/class.h.erb
119
119
  - lib/erebus/generators/templates/ignore.erb
120
120
  - lib/erebus/generators/templates/main.cpp.erb
121
+ - lib/erebus/generators/templates/project.erebus.erb
121
122
  - lib/erebus/generators/templates/rake.erb
122
123
  - lib/erebus/version.rb
123
- homepage: ''
124
+ homepage: https://github.com/cajun-code/erebus
124
125
  licenses: []
125
126
  post_install_message:
126
127
  rdoc_options: []