pullentity-client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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,146 @@
1
+ require "middleman"
2
+
3
+ module Pullentity::Client::Helpers
4
+
5
+ #TODO separate elements in specific classes:
6
+ # views, asides, articles, header, tabbar, toolbar etc...
7
+
8
+ def footer(opts={}, &block)
9
+ content_tag :footer , opts do
10
+ capture(&block)
11
+ end
12
+ end
13
+
14
+ def article(opts={}, &block)
15
+ content_tag :article , opts do
16
+ capture(&block)
17
+ end
18
+ end
19
+
20
+ def section(opts={}, &block)
21
+ content_tag :section , opts do
22
+ capture(&block)
23
+ end
24
+ end
25
+
26
+ def header(opts={}, &block)
27
+ content_tag :header , opts do
28
+ capture(&block)
29
+ end
30
+ end
31
+
32
+ def hgroup(opts={}, &block)
33
+ if block_given?
34
+ content_tag :hgroup, options do
35
+ capture(&block)
36
+ end
37
+ else
38
+ content_tag :hgroup do
39
+ content_tag( :h1 , opts[:title]).concat(
40
+ content_tag( :h2 , opts[:subtitle])
41
+ )
42
+ end
43
+ end
44
+ end
45
+
46
+ def list_view(opts={}, &block)
47
+ options = {:class=>opts[:class]}.merge({"data-type" => "listview"})
48
+ content_tag :ul, options do
49
+ capture(&block)
50
+ end
51
+ end
52
+
53
+ def list_item(opts={}, &block)
54
+ options = {:class=>opts[:class]}
55
+ options = options.merge({ :class=> "#{options[:class]} list-divider"}) if opts[:divider] == true
56
+ arrow = content_tag :div , :class=>"aside" do
57
+ content_tag( :i, "",{:class=>"icon-chevron-#{opts[:arrow]}"})
58
+ end if opts[:arrow].present?
59
+
60
+ if block_given?
61
+ content_tag :li, options do
62
+ capture(&block) << (arrow || "")
63
+ end
64
+ else
65
+ content_tag :li, options do
66
+ content_tag :h1 do
67
+ opts[:content]
68
+ end
69
+ end
70
+ end
71
+ end
72
+
73
+ def divider(opts={}, &block)
74
+ if block_given?
75
+ list_item({:divider=>true}.merge(opts)) do
76
+ capture(&block)
77
+ end
78
+ else
79
+ list_item({:divider=>true}.merge(opts))
80
+ end
81
+ end
82
+
83
+ def nav(opts={}, &block)
84
+ if block_given?
85
+ content_tag(:nav, opts) do
86
+ capture(&block)
87
+ end
88
+ else
89
+ end
90
+ end
91
+
92
+ def tabbar(opts={}, &block)
93
+ opts = opts.merge({"data-type" => "tabbar"})
94
+ nav(opts, &block)
95
+ end
96
+
97
+ def toolbar(opts={}, &block)
98
+ opts = opts.merge({"data-type" => "toolbar"})
99
+ if opts[:control]
100
+ auto = opts[:auto] ? "autoWidth" : ""
101
+ nav(opts.reject!{ |k| k == :control || k == :auto }) do
102
+ content_tag(:div, :class=>"control-group #{auto}") do
103
+ capture(&block)
104
+ end
105
+ end
106
+ else
107
+ nav(opts, &block)
108
+ end
109
+ end
110
+
111
+ def icon(type, opts={}, &block)
112
+ if block_given?
113
+ capture(&block) <<
114
+ content_tag( :i, "",{:class=>"icon-#{type}"})
115
+ else
116
+ name = opts[:text].present? ? content_tag( :span, opts[:text]) : ""
117
+ name <<
118
+ content_tag( :i, "",{:class=>"icon-#{type}"})
119
+ end
120
+ end
121
+
122
+ def dialog(opts, &block)
123
+ options = {:role => "dialog", :data=>{:type=>opts[:type] || "modal", :transition=>opts[:transition] || "slideup"}}
124
+ opts = opts.merge(options)
125
+ if block_given?
126
+ content_tag(:div, opts) do
127
+ capture(&block)
128
+ end
129
+ else
130
+ end
131
+ end
132
+
133
+ def render_tabbar(tabbar)
134
+ partial("views/tabbars/#{tabbar}")
135
+ end
136
+
137
+ def render_dialog(dialog)
138
+ partial("views/dialogs/#{dialog}")
139
+ end
140
+
141
+ def render_toolbar(tabbar)
142
+ partial("views/toolbars/#{tabbar}")
143
+ end
144
+
145
+
146
+ end
@@ -0,0 +1,14 @@
1
+ module Pullentity
2
+ module Client
3
+ class Logger
4
+
5
+ def self.report(msg)
6
+ $stdout.puts(msg.green.bold)
7
+ end
8
+
9
+ def self.error(msg)
10
+ $stderr.puts(msg.red.bold)
11
+ end
12
+ end
13
+ end
14
+ end