roject 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad19a40c37044d2c05db12edde1618900c5f2897
4
- data.tar.gz: 4a7050a650334712f4d7b96b4b164e6229aa3404
3
+ metadata.gz: 5265b6ec336684e4ba63f8fb0348512446e55f16
4
+ data.tar.gz: 26971fbf99b1b2ccac6d935ab74acaebc78dcd3a
5
5
  SHA512:
6
- metadata.gz: ba8034309255d69673d30b41c6044fe3c5369ed5fa73003139e58043bc939e43a6f41d258ed07aa422c28645035d0ddf1d0fcddae7382ec572536ea3d7868cee
7
- data.tar.gz: 9757271c4518331712df7265bd6f2b00e1b01b23886a8ab20712da7a40141a57b9ed779955a1fefcbee80f225698694e4253349328cc8d53dee1fc8936ec413f
6
+ metadata.gz: c7fc1107661b11a7818ffb400fc1da28b76589eed4c78478ab85268cb4735f6669251ae9affb00b7e419631a857e908df01fddd232eb8c074f76187d75c1336c
7
+ data.tar.gz: 63de4a62904dbf091ce60006df1c5ad46be5be35b86ccc01ea50045640e3f61d067dad914b1a9d32a664dc8f44b28b8f9df316b8b65c10d4f056fd22b33674b9
@@ -0,0 +1,5 @@
1
+ config project_name: "Foo",
2
+ author: "Anshul Kharbanda",
3
+ created: "7 - 24 - 2016",
4
+ short_description: "Foo bar",
5
+ long_description: "Foo bar baz ju jar jaz nu nar naz"
@@ -8,8 +8,6 @@ long_description: "Nowadays everybody wanna talk like" \
8
8
  " when they move their lips just a bunch of gibberish" \
9
9
  " and they all acting like they forgot about Dre."
10
10
 
11
- =begin
12
-
13
11
  #---------------------------MAKERS---------------------------
14
12
 
15
13
  # Header file
@@ -32,6 +30,4 @@ task :module do |args|
32
30
  # Create source and header
33
31
  make :header, args
34
32
  make :source, args
35
- end
36
-
37
- =end
33
+ end
data/lib/project.rb CHANGED
@@ -28,6 +28,9 @@ module Roject
28
28
  # Includes
29
29
  include Helpers
30
30
 
31
+ # Default filename
32
+ FILENAME_DEFAULT = "project.rb"
33
+
31
34
  # Default configuration
32
35
  CONFIG_DEFAULT = {
33
36
  project_name: "[project-name]",
@@ -43,9 +46,10 @@ module Roject
43
46
  # Loads a Project from the project file with the given filename
44
47
  #
45
48
  # Parameter: filename - the name of the file to parse
49
+ # (defaults to the default filename)
46
50
  #
47
51
  # Return: Project loaded from the file
48
- def self.load filename
52
+ def self.load filename=FILENAME_DEFAULT
49
53
  project = Roject::Project.new
50
54
  project.instance_eval(IO.read(filename))
51
55
  return project
data/lib/roject.rb CHANGED
@@ -20,5 +20,5 @@ require_relative "project"
20
20
  # Created: 7 - 8 - 2016
21
21
  module Roject
22
22
  # The Version of Roject
23
- VERSION = "0.6.0"
23
+ VERSION = "0.7.0"
24
24
  end
data/spec/project_spec.rb CHANGED
@@ -10,9 +10,7 @@ Author: Anshul Kharbanda
10
10
  Created: 7 - 8 - 2016
11
11
 
12
12
  =end
13
-
14
- # Spec require
15
- require_relative "spec_require"
13
+ require_relative "../lib/roject"
16
14
 
17
15
  # Describing Roject::Project
18
16
  #
@@ -28,7 +26,7 @@ describe Roject::Project do
28
26
  @config = Roject::Project::CONFIG_DEFAULT.merge({
29
27
  project_name: "Foo",
30
28
  author: "Anshul Kharbanda",
31
- created: "7 - 23 - 2016",
29
+ created: "7 - 24 - 2016",
32
30
  short_description: "Foo bar",
33
31
  long_description: "Foo bar baz ju lar laz nu kar kaz"
34
32
  })
@@ -38,9 +36,9 @@ describe Roject::Project do
38
36
  #
39
37
  # If a hash is given, sets the Project configuration to the hash.
40
38
  # Else, returns the configuration of the Project.
41
- #
39
+ #
42
40
  # Parameter: hash - the hash to configure the project with
43
- #
41
+ #
44
42
  # Return: the configuration of the Project
45
43
  describe '#config' do
46
44
  context 'with no arguments given' do
@@ -65,9 +63,22 @@ describe Roject::Project do
65
63
  #
66
64
  # Return: Project loaded from the file
67
65
  describe '::load' do
68
- it 'loads a project from the given filename' do
69
- expect{@project = Roject::Project.load "project.rb"}.not_to raise_error
70
- expect(@project).to be_an_instance_of Roject::Project
66
+ context 'with a filename given' do
67
+ it 'loads a project from the given filename' do
68
+ expect{@project = Roject::Project.load("project.rb")}.not_to raise_error
69
+ expect(@project).to be_an_instance_of Roject::Project
70
+ end
71
+ end
72
+
73
+ context 'with no filename given' do
74
+ it 'loads a project from the default filename' do
75
+ expect{@project = Roject::Project.load}.not_to raise_error
76
+ expect(@project).to be_an_instance_of Roject::Project
77
+ end
78
+ end
79
+
80
+ after :all do
81
+ @project.instance_variable_set :@makers, {}
71
82
  end
72
83
  end
73
84
 
@@ -81,34 +92,34 @@ describe Roject::Project do
81
92
  # Before all
82
93
  before :all do
83
94
  @path = "path/to/file"
95
+ @config = @project.config
84
96
 
85
97
  # ----------------------FILE INFO----------------------
86
98
 
87
99
  @header = {
88
- name: :header,
89
- path: "include/@(project_name)/@(path)",
90
- template: "header.general",
100
+ name: :header,
101
+ path: "include/@(project_name)/@(path)",
102
+ template: "header.general",
91
103
  extension: "h",
92
- out: "include/#{@project.config[:project_name]}/#{@path}.h",
93
- text: IO.read("output/testheader.h")
104
+ out: "include/#{@config[:project_name]}/#{@path}.h",
105
+ text: IO.read("output/testheader.h")
94
106
  }
95
107
 
96
108
  @source = {
97
- name: :source,
98
- path: "src/@(path)",
99
- template: "source.general",
109
+ name: :source,
110
+ path: "src/@(path)",
111
+ template: "source.general",
100
112
  extension: "cpp",
101
- out: "src/#{@path}.cpp",
102
- text: IO.read("output/testsource.cpp")
113
+ out: "src/#{@path}.cpp",
114
+ text: IO.read("output/testsource.cpp")
103
115
  }
104
116
 
105
117
  # ----------------------TASK INFO----------------------
106
118
 
107
119
  @module = {
108
- name: :module,
120
+ name: :module,
109
121
  block: Proc.new do |args|
110
122
  args[:header_id] = c_header_id(args[:path])
111
-
112
123
  make :header, args
113
124
  make :source, args
114
125
  end
@@ -138,7 +149,7 @@ describe Roject::Project do
138
149
 
139
150
  # Template
140
151
  expect(fmkr.instance_variable_get(:@template)).to be_an_instance_of General::GIO
141
- expect(fmkr.instance_variable_get(:@template).source).to eql "#{@project.config[:directory][:templates]}/#{ft[:template]}"
152
+ expect(fmkr.instance_variable_get(:@template).source).to eql "#{@config[:directory][:templates]}/#{ft[:template]}"
142
153
 
143
154
  # Extension
144
155
  expect(fmkr.instance_variable_get(:@extension)).to eql ft[:extension]
@@ -206,4 +217,6 @@ describe Roject::Project do
206
217
  after :each do FileUtils.rmtree ["include", "src"] end
207
218
  end
208
219
  end
220
+
221
+ after :all do Dir.chdir "../.." end
209
222
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anshul Kharbanda
@@ -14,56 +14,56 @@ dependencies:
14
14
  name: general
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.8.3
33
+ version: 1.8.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.8.3
40
+ version: 1.8.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.4.4
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.4.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 11.1.2
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 11.1.2
69
69
  description: Roject is a programming project manager written in Ruby. With Roject,
@@ -77,12 +77,9 @@ files:
77
77
  - LICENSE
78
78
  - README.md
79
79
  - Rakefile
80
- - exp/loadsaveable/foo.bar
81
- - exp/loadsaveable/foo.json
82
- - exp/loadsaveable/foo.yaml
83
- - exp/loadsaveable/foo.yml
84
80
  - exp/project/_templates/header.general
85
81
  - exp/project/_templates/source.general
82
+ - exp/project/foobar.rb
86
83
  - exp/project/output/testheader.h
87
84
  - exp/project/output/testsource.cpp
88
85
  - exp/project/project.rb
@@ -91,7 +88,6 @@ files:
91
88
  - lib/project.rb
92
89
  - lib/roject.rb
93
90
  - spec/project_spec.rb
94
- - spec/spec_require.rb
95
91
  homepage:
96
92
  licenses:
97
93
  - GPL-3.0
@@ -1 +0,0 @@
1
- project_name > project
@@ -1,4 +0,0 @@
1
- {
2
- "name": "project",
3
- "author": "Anshul Kharbanda"
4
- }
@@ -1,3 +0,0 @@
1
- ---
2
- name: project
3
- author: Anshul Kharbanda
@@ -1,3 +0,0 @@
1
- ---
2
- name: project
3
- author: Anshul Kharbanda
data/spec/spec_require.rb DELETED
@@ -1,15 +0,0 @@
1
- =begin
2
-
3
- Program: Roject
4
-
5
- Roject is a programming project manager written in Ruby.
6
- With Roject, you can create and edit projects based on templates
7
- using simple commands without a heavy IDE.
8
-
9
- Author: Anshul Kharbanda
10
- Created: 7 - 8 - 2016
11
-
12
- =end
13
-
14
- # Required files for spec
15
- require_relative "../lib/project"