roject 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +105 -0
- data/lib/loadsaveable.rb +1 -1
- data/lib/project.rb +2 -3
- data/lib/roject.rb +24 -0
- data/spec/parsers_spec.rb +4 -4
- data/spec/shared/loadsaveable_spec.rb +8 -2
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a88a1601c05705728fe7e26a4e677653b70e50
|
4
|
+
data.tar.gz: e968d8fa6e8161b388db2e32a54ea0d3eb6f6ab5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d81ba53e80e147143fd55b1a64fb7a119f1b707633430f80ade4ea998ae2c361a4a9e867c299ae4a571e157eb7334f6c27e8f54e3fb36894bd85a886272d3a1c
|
7
|
+
data.tar.gz: ffe33a6c6842189bc2c694530542165e3aa42417517f19a0528ceee925df218a1e789961d38ebc3d7911196706ffc7d3059479f81a024e8efbd0466022781b2a
|
data/Rakefile
ADDED
@@ -0,0 +1,105 @@
|
|
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 libraries
|
15
|
+
require "rspec/core/rake_task"
|
16
|
+
|
17
|
+
# Requird files
|
18
|
+
require_relative "lib/roject"
|
19
|
+
|
20
|
+
# Directories
|
21
|
+
GEMDIR = "gem"
|
22
|
+
SPECDIR = "spec"
|
23
|
+
|
24
|
+
#----------------------------------RSPEC----------------------------------
|
25
|
+
|
26
|
+
RSpec::Core::RakeTask.new :spec do |task|
|
27
|
+
task.pattern = "#{SPECDIR}/*_spec.rb"
|
28
|
+
task.rspec_opts = "--format documentation",
|
29
|
+
"--color"
|
30
|
+
end
|
31
|
+
|
32
|
+
#-----------------------------------GEM-----------------------------------
|
33
|
+
|
34
|
+
namespace :gem do
|
35
|
+
|
36
|
+
#----------------------------------GEM CLEAR TASKS----------------------------------
|
37
|
+
|
38
|
+
namespace :clear do
|
39
|
+
desc "Clear all gems"
|
40
|
+
task :all do
|
41
|
+
sh "rm #{GEMDIR}/*.gem"
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Clear old gems"
|
45
|
+
task :old do
|
46
|
+
sh "rm #{FileList.new("#{GEMDIR}/*.gem")
|
47
|
+
.exclude("#{GEMDIR}/roject-#{Roject::VERSION}.gem")}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
#----------------------------------GEM BUILD TASKS----------------------------------
|
52
|
+
|
53
|
+
desc "Build gem and push to Rubygems"
|
54
|
+
task :push => "#{GEMDIR}/roject-#{Roject::VERSION}.gem" do |task|
|
55
|
+
sh "gem push #{task.source}"
|
56
|
+
end
|
57
|
+
|
58
|
+
desc "Build gem and install locally"
|
59
|
+
task :install => "#{GEMDIR}/roject-#{Roject::VERSION}.gem" do |task|
|
60
|
+
sh "gem install #{task.source}"
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "Just buid gem"
|
64
|
+
task :build => "#{GEMDIR}/roject-#{Roject::VERSION}.gem"
|
65
|
+
|
66
|
+
#-------------------------------BUILD GEM FROM GEMSPEC------------------------------
|
67
|
+
|
68
|
+
file "#{GEMDIR}/roject-#{Roject::VERSION}.gem" => "roject.gemspec" do |task|
|
69
|
+
sh "gem build #{task.source}"
|
70
|
+
sh "mv #{File.basename(task.name)} #{File.dirname(task.name)}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
#-----------------------------------GIT-----------------------------------
|
75
|
+
|
76
|
+
namespace :git do
|
77
|
+
desc "Push changes to remote"
|
78
|
+
task :push, [:message] => :commit do
|
79
|
+
sh "git push origin master"
|
80
|
+
end
|
81
|
+
|
82
|
+
desc "Commit changes"
|
83
|
+
task :commit, [:message] do |task, args|
|
84
|
+
sh "git add --all"
|
85
|
+
sh "git commit -m #{args[:message].inspect}"
|
86
|
+
end
|
87
|
+
|
88
|
+
desc "Pull from repo"
|
89
|
+
task :pull do
|
90
|
+
sh "git pull origin master"
|
91
|
+
end
|
92
|
+
|
93
|
+
desc "Soft git reset"
|
94
|
+
task :reset do
|
95
|
+
sh "git reset"
|
96
|
+
end
|
97
|
+
|
98
|
+
desc "Hard git reset"
|
99
|
+
task :reset_hard do
|
100
|
+
sh "git reset --hard HEAD"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Default spec
|
105
|
+
task :default => "spec"
|
data/lib/loadsaveable.rb
CHANGED
@@ -22,7 +22,7 @@ module Roject
|
|
22
22
|
# Implementing objects can be loaded from and saved to files in
|
23
23
|
# any of the supported data storage formats.
|
24
24
|
#
|
25
|
-
# Formats: json
|
25
|
+
# Formats: json
|
26
26
|
#
|
27
27
|
# Note: Implementing objects need to respond to the :hash method
|
28
28
|
# which returns a hash of the data that needs to be saved
|
data/lib/project.rb
CHANGED
@@ -34,9 +34,8 @@ module Roject
|
|
34
34
|
@project = hash
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
end
|
37
|
+
# This is a test method and is depricated by default. Do not use!
|
38
|
+
def config(hash); @project = hash; end
|
40
39
|
|
41
40
|
# Returns a hash of the data contained in the project
|
42
41
|
#
|
data/lib/roject.rb
ADDED
@@ -0,0 +1,24 @@
|
|
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
|
+
# Available files
|
15
|
+
require_relative "project"
|
16
|
+
|
17
|
+
# Roject is a programming project manager written in Ruby.
|
18
|
+
#
|
19
|
+
# Author: Anshul Kharbanda
|
20
|
+
# Created: 7 - 8 - 2016
|
21
|
+
module Roject
|
22
|
+
# The Version of Roject
|
23
|
+
VERSION = "0.1.1"
|
24
|
+
end
|
data/spec/parsers_spec.rb
CHANGED
@@ -35,12 +35,12 @@ describe Roject::Parsers do
|
|
35
35
|
#
|
36
36
|
# Author: Anshul Kharbanda
|
37
37
|
# Created: 7 - 11 - 2016
|
38
|
-
describe 'JSONParser' do
|
38
|
+
describe '::JSONParser' do
|
39
39
|
|
40
40
|
#----------------------------------BEFORE-----------------------------------
|
41
41
|
|
42
42
|
before :all do
|
43
|
-
@
|
43
|
+
@text = JSON.pretty_generate(@hash, indent: "\t")
|
44
44
|
@parser = Roject::Parsers::JSONParser
|
45
45
|
end
|
46
46
|
|
@@ -55,7 +55,7 @@ describe Roject::Parsers do
|
|
55
55
|
# Return: the hash parsed from the text
|
56
56
|
describe '::parse' do
|
57
57
|
it 'parses the given JSON text into a ruby hash' do
|
58
|
-
expect(@parser.parse(@
|
58
|
+
expect(@parser.parse(@text)).to eql @hash
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -68,7 +68,7 @@ describe Roject::Parsers do
|
|
68
68
|
# Return: the given hash formatted to pretty json
|
69
69
|
describe '::format' do
|
70
70
|
it 'formats the given hash into pretty JSON' do
|
71
|
-
expect(@parser.format(@hash)).to eql @
|
71
|
+
expect(@parser.format(@hash)).to eql @text
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -13,10 +13,16 @@ Created: 7 - 8 - 2016
|
|
13
13
|
|
14
14
|
# Describing loadsaveable_class
|
15
15
|
#
|
16
|
-
#
|
16
|
+
# Implementing objects can be loaded from and saved to files in
|
17
|
+
# any of the supported data storage formats.
|
18
|
+
#
|
19
|
+
# Formats: json
|
20
|
+
#
|
21
|
+
# Note: Implementing objects need to respond to the :hash method
|
22
|
+
# which returns a hash of the data that needs to be saved
|
17
23
|
#
|
18
24
|
# Author: Anshul Kharbanda
|
19
|
-
# Created: 7 -
|
25
|
+
# Created: 7 - 11 - 2016
|
20
26
|
shared_examples "loadsaveable" do |loadsaveable_class|
|
21
27
|
#---------------------------------------BEFORE----------------------------------------
|
22
28
|
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anshul Kharbanda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
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
33
|
version: 1.8.3
|
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
40
|
version: 1.8.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :
|
47
|
+
version: 3.4.4
|
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
|
-
version:
|
54
|
+
version: 3.4.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
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
|
-
version:
|
68
|
+
version: 11.1.2
|
69
69
|
description: Roject is a programming project manager written in Ruby. With Roject,
|
70
70
|
you can create and edit projects based on templates using simple commands without
|
71
71
|
a heavy IDE.
|
@@ -76,11 +76,13 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- LICENSE
|
78
78
|
- README.md
|
79
|
+
- Rakefile
|
79
80
|
- exp/project.foo
|
80
81
|
- exp/project.json
|
81
82
|
- lib/loadsaveable.rb
|
82
83
|
- lib/parsers.rb
|
83
84
|
- lib/project.rb
|
85
|
+
- lib/roject.rb
|
84
86
|
- spec/parsers_spec.rb
|
85
87
|
- spec/project_spec.rb
|
86
88
|
- spec/shared/loadsaveable_spec.rb
|