pullentity-client 0.0.1
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.
- checksums.yaml +15 -0
- data/.DS_Store +0 -0
- data/.gitignore +47 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/pullentity +5 -0
- data/lib/.DS_Store +0 -0
- data/lib/pullentity-client/.DS_Store +0 -0
- data/lib/pullentity-client/builder/middleman.rb +14 -0
- data/lib/pullentity-client/cli.rb +85 -0
- data/lib/pullentity-client/generate/auth.rb +173 -0
- data/lib/pullentity-client/generate/exporter.rb +107 -0
- data/lib/pullentity-client/generate/project.rb +99 -0
- data/lib/pullentity-client/generate/view.rb +47 -0
- data/lib/pullentity-client/helpers.rb +146 -0
- data/lib/pullentity-client/logger.rb +14 -0
- data/lib/pullentity-client/templates/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/assets/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.svg +255 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/lib/pullentity-client/templates/app/assets/images/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/assets/images/favicon.ico +0 -0
- data/lib/pullentity-client/templates/app/assets/javascripts/application.js.erb +4 -0
- data/lib/pullentity-client/templates/app/assets/javascripts/mustache.js +535 -0
- data/lib/pullentity-client/templates/app/assets/stylesheets/application.css.scss +1 -0
- data/lib/pullentity-client/templates/app/assets/stylesheets/customtheme.css.scss +1 -0
- data/lib/pullentity-client/templates/app/index.html.haml +15 -0
- data/lib/pullentity-client/templates/app/views/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/views/list.haml +11 -0
- data/lib/pullentity-client/templates/app/views/shared/body.haml +26 -0
- data/lib/pullentity-client/templates/app/views/shared/css.haml +48 -0
- data/lib/pullentity-client/templates/app/views/shared/head.haml +19 -0
- data/lib/pullentity-client/templates/app/views/shared/js.haml +43 -0
- data/lib/pullentity-client/templates/app/views/themes/home.haml +21 -0
- data/lib/pullentity-client/templates/app/views/themes/theme1.haml +21 -0
- data/lib/pullentity-client/templates/defaults/Gemfile.erb +8 -0
- data/lib/pullentity-client/templates/defaults/LICENSE.erb +1 -0
- data/lib/pullentity-client/templates/defaults/Readme.mkd.erb +1 -0
- data/lib/pullentity-client/templates/defaults/build.yml.erb +2 -0
- data/lib/pullentity-client/templates/defaults/config.erb +23 -0
- data/lib/pullentity-client/templates/defaults/gitignore.erb +2 -0
- data/lib/pullentity-client/templates/defaults/layout.haml.erb +13 -0
- data/lib/pullentity-client/templates/defaults/pullentity.yml.erb +5 -0
- data/lib/pullentity-client/templates/defaults/test-data.js.erb +87 -0
- data/lib/pullentity-client/templates/rakefile +0 -0
- data/lib/pullentity-client/templates/specs/app_spec.coffee.erb +3 -0
- data/lib/pullentity-client/utils.rb +81 -0
- data/lib/pullentity-client/version.rb +5 -0
- data/lib/pullentity-client.rb +39 -0
- data/pullentity-client.gemspec +39 -0
- data/spec/cli/command_spec.rb +90 -0
- data/spec/pullentity-client/builder/middleman_spec.rb +22 -0
- data/spec/pullentity-client/generate/exporter_spec.rb +53 -0
- data/spec/pullentity-client/generate/project_spec.rb +90 -0
- data/spec/pullentity-client/logger_spec.rb +25 -0
- data/spec/pullentity-client/utils_spec.rb +94 -0
- data/spec/spec_helper.rb +42 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +255 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/images/.DS_Store +0 -0
- data/vendor/assets/images/pullentity/.DS_Store +0 -0
- data/vendor/assets/javascripts/pullentity/.DS_Store +0 -0
- data/vendor/assets/javascripts/pullentity.js +0 -0
- data/vendor/assets/stylesheets/.DS_Store +0 -0
- data/vendor/assets/stylesheets/pullentity/themes/default.css.scss +0 -0
- data/vendor/assets/stylesheets/pullentity.css.scss +1 -0
- metadata +335 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe "The utilities" do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
class Klass
|
7
|
+
class << self
|
8
|
+
include ::Pullentity::Client::Utils
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return the base location" do
|
14
|
+
Klass.base_location.should == Pathname.new(Dir.pwd)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should have the base location alias, location return the base location" do
|
18
|
+
Klass.location.should == Pathname.new(Dir.pwd)
|
19
|
+
end
|
20
|
+
|
21
|
+
context "Creating new files and deleting them" do
|
22
|
+
it "should create a new file" do
|
23
|
+
Klass.create_new_file("DEMO")
|
24
|
+
File.exists?(Pathname.new(Dir.pwd).join("DEMO")).should be_true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should delete the new file" do
|
28
|
+
Klass.remove_files("DEMO")
|
29
|
+
File.exists?(Pathname.new(Dir.pwd).join("DEMO")).should be_false
|
30
|
+
end
|
31
|
+
|
32
|
+
after(:all) do
|
33
|
+
remove_directories("DEMO")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context "Touching files into existence like no one has touched a file before" do
|
38
|
+
it "should come alive!!" do
|
39
|
+
Klass.touch("File", "into", "existence")
|
40
|
+
File.exists?(Pathname.new(Dir.pwd).join("File")).should be_true
|
41
|
+
File.exists?(Pathname.new(Dir.pwd).join("into")).should be_true
|
42
|
+
File.exists?(Pathname.new(Dir.pwd).join("existence")).should be_true
|
43
|
+
end
|
44
|
+
|
45
|
+
after(:all) do
|
46
|
+
remove_directories("File", "into", "existence")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context "Creating and deleting directories" do
|
51
|
+
it "should create some directories" do
|
52
|
+
Klass.create_directories("Dude", "looks", "like", "a", "lady")
|
53
|
+
File.exists?(Pathname.new(Dir.pwd).join("Dude")).should be_true
|
54
|
+
File.exists?(Pathname.new(Dir.pwd).join("looks")).should be_true
|
55
|
+
File.exists?(Pathname.new(Dir.pwd).join("like")).should be_true
|
56
|
+
File.exists?(Pathname.new(Dir.pwd).join("a")).should be_true
|
57
|
+
File.exists?(Pathname.new(Dir.pwd).join("lady")).should be_true
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should delete the created directories" do
|
61
|
+
Klass.remove_directories("Dude", "looks", "like", "a", "lady")
|
62
|
+
File.exists?(Pathname.new(Dir.pwd).join("Dude")).should be_false
|
63
|
+
File.exists?(Pathname.new(Dir.pwd).join("looks")).should be_false
|
64
|
+
File.exists?(Pathname.new(Dir.pwd).join("like")).should be_false
|
65
|
+
File.exists?(Pathname.new(Dir.pwd).join("a")).should be_false
|
66
|
+
File.exists?(Pathname.new(Dir.pwd).join("lady")).should be_false
|
67
|
+
end
|
68
|
+
|
69
|
+
after(:all) do
|
70
|
+
remove_directories("Dude", "looks", "like", "a", "lady")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context "Test the Utils logging" do
|
75
|
+
before(:each) do
|
76
|
+
@stdout_orig = $stdout
|
77
|
+
$stdout = StringIO.new
|
78
|
+
|
79
|
+
@stderr_orig = $stderr
|
80
|
+
$stderr = StringIO.new
|
81
|
+
end
|
82
|
+
|
83
|
+
it "should log the error" do
|
84
|
+
Klass.error("Failed")
|
85
|
+
$stderr.string.should == "\e[1m\e[31mFailed\e[0m\e[0m\n"
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should log the success" do
|
89
|
+
Klass.log("Success")
|
90
|
+
$stdout.string.should == "\e[1m\e[32mSuccess\e[0m\e[0m\n"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
require 'rspec'
|
3
|
+
require 'debugger'
|
4
|
+
require File.join(File.dirname(__FILE__), '../lib', 'pullentity-client')
|
5
|
+
#require 'lib/pullentity-client'
|
6
|
+
require 'stringio'
|
7
|
+
#require 'config'
|
8
|
+
|
9
|
+
ENV["pullentity_rspec"] = "test"
|
10
|
+
|
11
|
+
RSpec.configure do |config|
|
12
|
+
|
13
|
+
def capture_with_status(stream)
|
14
|
+
exit_status = 0
|
15
|
+
begin
|
16
|
+
stream = stream.to_s
|
17
|
+
eval "$#{stream} = StringIO.new"
|
18
|
+
begin
|
19
|
+
yield
|
20
|
+
rescue SystemExit => system_exit # catch any exit calls
|
21
|
+
exit_status = system_exit.status
|
22
|
+
end
|
23
|
+
result = eval("$#{stream}").string
|
24
|
+
ensure
|
25
|
+
eval("$#{stream} = #{stream.upcase}")
|
26
|
+
end
|
27
|
+
return result, exit_status
|
28
|
+
end
|
29
|
+
|
30
|
+
def remove_directories(*names)
|
31
|
+
project_dir = Pathname.new(Dir.pwd)
|
32
|
+
names.each do |name|
|
33
|
+
FileUtils.rm_rf(project_dir.join(name)) if FileTest.exists?(project_dir.join(name))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def fixture_file(type, filename)
|
38
|
+
dir_name = type.to_s + "s"
|
39
|
+
File.dirname(__FILE__) + "/fixtures/#{dir_name}/#{filename}"
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
Binary file
|