pointrb 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/.gitignore +16 -0
  2. data/.rspec +1 -0
  3. data/.ruby-version +1 -0
  4. data/Gemfile +2 -1
  5. data/Gemfile.lock +40 -26
  6. data/README.md +1 -86
  7. data/Rakefile +5 -0
  8. data/TODO.md +35 -1
  9. data/bin/pointrb +35 -0
  10. data/cucumber.yml +3 -0
  11. data/features/create_layout.feature +96 -0
  12. data/features/create_new_project.feature +29 -0
  13. data/features/pointrb_setup.feature +22 -0
  14. data/features/step_definitions.rb +96 -0
  15. data/features/support/env.rb +26 -0
  16. data/features/support/helper.rb +62 -0
  17. data/features/test.feature +0 -0
  18. data/gemfiles/Gemfile.default +2 -1
  19. data/lib/bob_the_helper/command/command_result.rb +12 -0
  20. data/lib/bob_the_helper/command.rb +49 -0
  21. data/lib/bob_the_helper/environment.rb +27 -0
  22. data/lib/bob_the_helper/file_system/exceptions.rb +11 -0
  23. data/lib/bob_the_helper/file_system.rb +245 -0
  24. data/lib/bob_the_helper.rb +5 -0
  25. data/lib/pointrb/actions/check_if_pointrb_has_already_been_initialized.rb +15 -0
  26. data/lib/pointrb/actions/check_project_path.rb +15 -0
  27. data/lib/pointrb/actions/create_layout.rb +16 -0
  28. data/lib/pointrb/actions/create_project_wrapper.rb +15 -0
  29. data/lib/pointrb/actions/determine_layout_directory.rb +14 -0
  30. data/lib/pointrb/actions/error_handler_commandline.rb +39 -0
  31. data/lib/pointrb/actions/initialize_pointrb.rb +15 -0
  32. data/lib/pointrb/actions/retrieve_layout_files.rb +16 -0
  33. data/lib/pointrb/actions/retrieve_parsed_layout.rb +17 -0
  34. data/lib/pointrb/actions/set_project_name.rb +15 -0
  35. data/lib/pointrb/actions/show_pointrb_version.rb +14 -0
  36. data/lib/pointrb/api.rb +36 -0
  37. data/lib/pointrb/directory.rb +25 -0
  38. data/lib/pointrb/exceptions.rb +22 -0
  39. data/lib/pointrb/layout.rb +16 -0
  40. data/lib/pointrb/layout_constructor.rb +58 -0
  41. data/lib/pointrb/layout_file.rb +24 -0
  42. data/lib/pointrb/layout_manager.rb +32 -0
  43. data/lib/pointrb/layout_storage_manager.rb +40 -0
  44. data/lib/pointrb/layout_tree.rb +45 -0
  45. data/lib/pointrb/pointrb_file.rb +33 -0
  46. data/lib/pointrb/project.rb +11 -0
  47. data/lib/pointrb/version.rb +1 -1
  48. data/lib/pointrb.rb +32 -0
  49. data/pointrb.gemspec +3 -2
  50. data/script/terminal +1 -0
  51. data/spec/bob_the_helper/command/command_spec.rb +55 -0
  52. data/spec/bob_the_helper/environment/environment_spec.rb +15 -0
  53. data/spec/bob_the_helper/file_system/file_system_spec.rb +279 -0
  54. data/spec/directory/directory_spec.rb +30 -0
  55. data/spec/hooks.rb +5 -0
  56. data/spec/layout/layout_spec.rb +20 -0
  57. data/spec/layout_constructor/layout_constructor_spec.rb +122 -0
  58. data/spec/layout_file/layout_file_spec.rb +49 -0
  59. data/spec/layout_manager/layout_manager_spec.rb +47 -0
  60. data/spec/layout_storage_manager/layout_storage_manager_spec.rb +58 -0
  61. data/spec/layout_tree/layout_tree_spec.rb +70 -0
  62. data/spec/pointrb_file/pointrb_file_spec.rb +34 -0
  63. data/spec/project/project_spec.rb +19 -0
  64. data/spec/spec_helper.rb +9 -13
  65. data/spec/support/capture.rb +19 -0
  66. data/spec/support/env.rb +0 -0
  67. data/spec/support/helper.rb +8 -0
  68. data/spec/support/hooks.rb +5 -0
  69. metadata +104 -5
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ describe PointRbFile do
4
+
5
+ it "has a path, content" do
6
+ PointRbFile.new('path', 'content')
7
+ end
8
+
9
+ it "can be created" do
10
+ file = PointRbFile.new('path', 'content')
11
+ file.base_dir = working_directory
12
+ file.create
13
+
14
+ file_path = File.join(working_directory, 'path')
15
+ result = File.exists?(file_path)
16
+
17
+ expect(result).to eq(true)
18
+ end
19
+
20
+ it "returns the full path" do
21
+ file = PointRbFile.new('path', 'content')
22
+ file.base_dir = working_directory
23
+
24
+ check = File.join(working_directory, 'path')
25
+ expect(file.full_path).to eq(check)
26
+ end
27
+
28
+ it "returns path if it starts with '/'" do
29
+ path = '/path'
30
+ file = PointRbFile.new(path, 'content')
31
+ file.base_dir = working_directory
32
+ expect(file.full_path).to eq(path)
33
+ end
34
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Project do
4
+ before(:each) do
5
+ @name = 'name'
6
+ switch_to_working_directory do
7
+ @project = Project.new(@name)
8
+ end
9
+ end
10
+
11
+ it "has a name" do
12
+ expect(@project.name).to eq(@name)
13
+ end
14
+
15
+ it "has a base_directory" do
16
+ path = File.join(working_directory, @name)
17
+ expect(@project.path).to eq(path)
18
+ end
19
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,13 +1,20 @@
1
1
  #encoding: utf-8
2
2
 
3
3
  $LOAD_PATH << File.expand_path('../lib' , File.dirname(__FILE__))
4
+ Dir.glob(File.join(File.dirname(__FILE__), 'support', '*.rb')).each { |f| require f }
4
5
 
5
6
  unless ENV['TRAVIS_CI'] == 'true'
6
7
  require 'pry'
7
8
  require 'debugger'
9
+ require 'debugger/completion'
8
10
  require 'ap'
9
11
  require 'ffaker'
10
12
  require 'benchmark'
13
+
14
+ # Debugger.settings[:autoeval] = true
15
+ # Debugger.settings[:autoirb] = true
16
+ # Debugger.settings[:autolist] = true
17
+ # Debugger.start
11
18
  end
12
19
 
13
20
  require 'stringio'
@@ -22,17 +29,6 @@ unless ENV['TRAVIS_CI'] == 'true'
22
29
  SimpleCov.start
23
30
  end
24
31
 
25
- require 'the_array_comparator'
26
- require 'the_array_comparator/testing_helper/data_set'
27
- require 'the_array_comparator/testing_helper/test_data'
28
- require 'the_array_comparator/testing_helper'
29
-
30
- RSpec.configure do |c|
31
- # c.treat_symbols_as_metadata_keys_with_true_values = true
32
- # c.filter_run_including :focus => true
33
- end
34
-
35
- include TheArrayComparator
36
- include TheArrayComparator::TestingHelper
32
+ require 'pointrb'
33
+ include PointRb
37
34
 
38
- #ENV['PATH'] = '/bin'
@@ -0,0 +1,19 @@
1
+ module Kernel
2
+ #
3
+ # Captures the given stream and returns it:
4
+ #
5
+ # stream = capture(:stdout) { puts 'Cool' }
6
+ # stream # => "Cool\n"
7
+ def capture(stream)
8
+ begin
9
+ stream = stream.to_s
10
+ eval "$#{stream} = StringIO.new"
11
+ yield
12
+ result = eval("$#{stream}").string
13
+ ensure
14
+ eval("$#{stream} = #{stream.upcase}")
15
+ end
16
+
17
+ result
18
+ end
19
+ end
File without changes
@@ -0,0 +1,8 @@
1
+ require 'bob_the_helper'
2
+
3
+ include BobTheHelper::FileSystem
4
+ include BobTheHelper::Command
5
+
6
+ def root_directory
7
+ File.expand_path('../../../', __FILE__)
8
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |c|
2
+ c.before(:all) do
3
+ cleanup_working_directory
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pointrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-23 00:00:00.000000000 Z
12
+ date: 2013-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: active_support
15
+ name: activesupport
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
@@ -43,13 +43,33 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
- description: Initialize project diretory base on templates
46
+ - !ruby/object:Gem::Dependency
47
+ name: rubytree
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Initialize project directory base on templates
47
63
  email:
48
64
  - dev@fedux.org
49
- executables: []
65
+ executables:
66
+ - pointrb
50
67
  extensions: []
51
68
  extra_rdoc_files: []
52
69
  files:
70
+ - .gitignore
71
+ - .rspec
72
+ - .ruby-version
53
73
  - API-GUIDE.md
54
74
  - CONTRIBUTIONS.md
55
75
  - Gemfile
@@ -59,13 +79,68 @@ files:
59
79
  - RELEASE_NOTES.md
60
80
  - Rakefile
61
81
  - TODO.md
82
+ - bin/pointrb
83
+ - cucumber.yml
84
+ - features/create_layout.feature
85
+ - features/create_new_project.feature
86
+ - features/pointrb_setup.feature
87
+ - features/step_definitions.rb
88
+ - features/support/env.rb
89
+ - features/support/helper.rb
90
+ - features/test.feature
62
91
  - gemfiles/Gemfile.default
63
92
  - gemfiles/Gemfile.travis
93
+ - lib/bob_the_helper.rb
94
+ - lib/bob_the_helper/command.rb
95
+ - lib/bob_the_helper/command/command_result.rb
96
+ - lib/bob_the_helper/environment.rb
97
+ - lib/bob_the_helper/file_system.rb
98
+ - lib/bob_the_helper/file_system/exceptions.rb
99
+ - lib/pointrb.rb
100
+ - lib/pointrb/actions/check_if_pointrb_has_already_been_initialized.rb
101
+ - lib/pointrb/actions/check_project_path.rb
102
+ - lib/pointrb/actions/create_layout.rb
103
+ - lib/pointrb/actions/create_project_wrapper.rb
104
+ - lib/pointrb/actions/determine_layout_directory.rb
105
+ - lib/pointrb/actions/error_handler_commandline.rb
106
+ - lib/pointrb/actions/initialize_pointrb.rb
107
+ - lib/pointrb/actions/retrieve_layout_files.rb
108
+ - lib/pointrb/actions/retrieve_parsed_layout.rb
109
+ - lib/pointrb/actions/set_project_name.rb
110
+ - lib/pointrb/actions/show_pointrb_version.rb
111
+ - lib/pointrb/api.rb
112
+ - lib/pointrb/directory.rb
113
+ - lib/pointrb/exceptions.rb
114
+ - lib/pointrb/layout.rb
115
+ - lib/pointrb/layout_constructor.rb
116
+ - lib/pointrb/layout_file.rb
117
+ - lib/pointrb/layout_manager.rb
118
+ - lib/pointrb/layout_storage_manager.rb
119
+ - lib/pointrb/layout_tree.rb
120
+ - lib/pointrb/pointrb_file.rb
121
+ - lib/pointrb/project.rb
64
122
  - lib/pointrb/version.rb
65
123
  - pointrb.gemspec
66
124
  - script/console
67
125
  - script/terminal
126
+ - spec/bob_the_helper/command/command_spec.rb
127
+ - spec/bob_the_helper/environment/environment_spec.rb
128
+ - spec/bob_the_helper/file_system/file_system_spec.rb
129
+ - spec/directory/directory_spec.rb
130
+ - spec/hooks.rb
131
+ - spec/layout/layout_spec.rb
132
+ - spec/layout_constructor/layout_constructor_spec.rb
133
+ - spec/layout_file/layout_file_spec.rb
134
+ - spec/layout_manager/layout_manager_spec.rb
135
+ - spec/layout_storage_manager/layout_storage_manager_spec.rb
136
+ - spec/layout_tree/layout_tree_spec.rb
137
+ - spec/pointrb_file/pointrb_file_spec.rb
138
+ - spec/project/project_spec.rb
68
139
  - spec/spec_helper.rb
140
+ - spec/support/capture.rb
141
+ - spec/support/env.rb
142
+ - spec/support/helper.rb
143
+ - spec/support/hooks.rb
69
144
  homepage: https://www.github.com/max_meyer/pointrb
70
145
  licenses: []
71
146
  post_install_message:
@@ -93,5 +168,29 @@ summary: ! 'PointRb is a project initializer which helps you to create a directo
93
168
  structure for your project. It supports profiles so that you can use different layouts
94
169
  for different projects: library, webapplication etc.'
95
170
  test_files:
171
+ - features/create_layout.feature
172
+ - features/create_new_project.feature
173
+ - features/pointrb_setup.feature
174
+ - features/step_definitions.rb
175
+ - features/support/env.rb
176
+ - features/support/helper.rb
177
+ - features/test.feature
178
+ - spec/bob_the_helper/command/command_spec.rb
179
+ - spec/bob_the_helper/environment/environment_spec.rb
180
+ - spec/bob_the_helper/file_system/file_system_spec.rb
181
+ - spec/directory/directory_spec.rb
182
+ - spec/hooks.rb
183
+ - spec/layout/layout_spec.rb
184
+ - spec/layout_constructor/layout_constructor_spec.rb
185
+ - spec/layout_file/layout_file_spec.rb
186
+ - spec/layout_manager/layout_manager_spec.rb
187
+ - spec/layout_storage_manager/layout_storage_manager_spec.rb
188
+ - spec/layout_tree/layout_tree_spec.rb
189
+ - spec/pointrb_file/pointrb_file_spec.rb
190
+ - spec/project/project_spec.rb
96
191
  - spec/spec_helper.rb
192
+ - spec/support/capture.rb
193
+ - spec/support/env.rb
194
+ - spec/support/helper.rb
195
+ - spec/support/hooks.rb
97
196
  has_rdoc: