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.
Files changed (75) hide show
  1. checksums.yaml +15 -0
  2. data/.DS_Store +0 -0
  3. data/.gitignore +47 -0
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +5 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +1 -0
  9. data/bin/pullentity +5 -0
  10. data/lib/.DS_Store +0 -0
  11. data/lib/pullentity-client/.DS_Store +0 -0
  12. data/lib/pullentity-client/builder/middleman.rb +14 -0
  13. data/lib/pullentity-client/cli.rb +85 -0
  14. data/lib/pullentity-client/generate/auth.rb +173 -0
  15. data/lib/pullentity-client/generate/exporter.rb +107 -0
  16. data/lib/pullentity-client/generate/project.rb +99 -0
  17. data/lib/pullentity-client/generate/view.rb +47 -0
  18. data/lib/pullentity-client/helpers.rb +146 -0
  19. data/lib/pullentity-client/logger.rb +14 -0
  20. data/lib/pullentity-client/templates/.DS_Store +0 -0
  21. data/lib/pullentity-client/templates/app/.DS_Store +0 -0
  22. data/lib/pullentity-client/templates/app/assets/.DS_Store +0 -0
  23. data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.eot +0 -0
  24. data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.svg +255 -0
  25. data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  26. data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.woff +0 -0
  27. data/lib/pullentity-client/templates/app/assets/images/.DS_Store +0 -0
  28. data/lib/pullentity-client/templates/app/assets/images/favicon.ico +0 -0
  29. data/lib/pullentity-client/templates/app/assets/javascripts/application.js.erb +4 -0
  30. data/lib/pullentity-client/templates/app/assets/javascripts/mustache.js +535 -0
  31. data/lib/pullentity-client/templates/app/assets/stylesheets/application.css.scss +1 -0
  32. data/lib/pullentity-client/templates/app/assets/stylesheets/customtheme.css.scss +1 -0
  33. data/lib/pullentity-client/templates/app/index.html.haml +15 -0
  34. data/lib/pullentity-client/templates/app/views/.DS_Store +0 -0
  35. data/lib/pullentity-client/templates/app/views/list.haml +11 -0
  36. data/lib/pullentity-client/templates/app/views/shared/body.haml +26 -0
  37. data/lib/pullentity-client/templates/app/views/shared/css.haml +48 -0
  38. data/lib/pullentity-client/templates/app/views/shared/head.haml +19 -0
  39. data/lib/pullentity-client/templates/app/views/shared/js.haml +43 -0
  40. data/lib/pullentity-client/templates/app/views/themes/home.haml +21 -0
  41. data/lib/pullentity-client/templates/app/views/themes/theme1.haml +21 -0
  42. data/lib/pullentity-client/templates/defaults/Gemfile.erb +8 -0
  43. data/lib/pullentity-client/templates/defaults/LICENSE.erb +1 -0
  44. data/lib/pullentity-client/templates/defaults/Readme.mkd.erb +1 -0
  45. data/lib/pullentity-client/templates/defaults/build.yml.erb +2 -0
  46. data/lib/pullentity-client/templates/defaults/config.erb +23 -0
  47. data/lib/pullentity-client/templates/defaults/gitignore.erb +2 -0
  48. data/lib/pullentity-client/templates/defaults/layout.haml.erb +13 -0
  49. data/lib/pullentity-client/templates/defaults/pullentity.yml.erb +5 -0
  50. data/lib/pullentity-client/templates/defaults/test-data.js.erb +87 -0
  51. data/lib/pullentity-client/templates/rakefile +0 -0
  52. data/lib/pullentity-client/templates/specs/app_spec.coffee.erb +3 -0
  53. data/lib/pullentity-client/utils.rb +81 -0
  54. data/lib/pullentity-client/version.rb +5 -0
  55. data/lib/pullentity-client.rb +39 -0
  56. data/pullentity-client.gemspec +39 -0
  57. data/spec/cli/command_spec.rb +90 -0
  58. data/spec/pullentity-client/builder/middleman_spec.rb +22 -0
  59. data/spec/pullentity-client/generate/exporter_spec.rb +53 -0
  60. data/spec/pullentity-client/generate/project_spec.rb +90 -0
  61. data/spec/pullentity-client/logger_spec.rb +25 -0
  62. data/spec/pullentity-client/utils_spec.rb +94 -0
  63. data/spec/spec_helper.rb +42 -0
  64. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  65. data/vendor/assets/fonts/fontawesome-webfont.svg +255 -0
  66. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  67. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  68. data/vendor/assets/images/.DS_Store +0 -0
  69. data/vendor/assets/images/pullentity/.DS_Store +0 -0
  70. data/vendor/assets/javascripts/pullentity/.DS_Store +0 -0
  71. data/vendor/assets/javascripts/pullentity.js +0 -0
  72. data/vendor/assets/stylesheets/.DS_Store +0 -0
  73. data/vendor/assets/stylesheets/pullentity/themes/default.css.scss +0 -0
  74. data/vendor/assets/stylesheets/pullentity.css.scss +1 -0
  75. 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
@@ -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