pullentity-client 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
- 0.0.1
1
+ 0.3.2
2
+ 2013/08/01
3
+ fix build helper
4
+ upgrade to mm 3.1.4
5
+ Redirect rack
6
+ 0.3.0
2
7
  2013/07/31
3
8
  Add template layout for backbone client side app
9
+ 0.0.1
4
10
  2013/03/23
5
11
  Add login interaction for api
6
12
  add select sites
@@ -1,5 +1,6 @@
1
1
  require "middleman"
2
2
  require 'middleman-target'
3
+
3
4
  URL_REMOTE = "http://pullentity.s3.amazonaws.com"
4
5
 
5
6
  module Pullentity::Client::Helpers
@@ -51,11 +52,15 @@ module Pullentity::Client::Helpers
51
52
  end
52
53
  end
53
54
 
54
-
55
55
  end
56
56
 
57
+ # config.rb
58
+ require 'rack/rewrite'
59
+
60
+
57
61
  module Pullentity::Client::MiddlemanConfig
58
62
  class << self
63
+
59
64
  def registered(app)
60
65
  app.helpers Pullentity::Client::Helpers
61
66
  app.set :site_name, site_name
@@ -69,13 +74,20 @@ module Pullentity::Client::MiddlemanConfig
69
74
  app.set :markdown, :layout_engine => :haml
70
75
  app.set :default_encoding, 'utf-8'
71
76
 
72
- app.compass_config do |config|
73
- # config is the Compass.configuration object
74
- config.output_style = :compact
77
+ app.configure :build do
75
78
  if target?(:pullentity)
76
- config.http_images_path = "#{URL_REMOTE}/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets"
79
+ activate :minify_css
80
+ activate :minify_javascript
81
+ app.set :http_prefix, "#{URL_REMOTE}"
82
+ app.set :images_dir, "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets"
77
83
  end
78
84
  end
85
+
86
+ app.use Rack::Rewrite do
87
+ r301 %r{/sections(.*)}, '/'
88
+ r301 %r{/projects(.*)}, '/'
89
+ end
90
+
79
91
  end
80
92
 
81
93
  def site_name
@@ -14,10 +14,4 @@ end
14
14
 
15
15
  activate :pullentity_config
16
16
 
17
- page "views/*", :layout => false
18
-
19
- configure :build do
20
- activate :minify_css
21
- activate :minify_javascript
22
- end
23
-
17
+ page "views/*", :layout => false
@@ -1,5 +1,5 @@
1
1
  module Pullentity
2
2
  module Client
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
@@ -10,6 +10,7 @@ require 'thor'
10
10
  require 'erubis'
11
11
  require 'nokogiri'
12
12
  require 'json'
13
+ require 'debugger'
13
14
 
14
15
  require 'tempfile'
15
16
  require 'pullentity-client/thor/shell/password'
@@ -26,12 +26,14 @@ Gem::Specification.new do |gem|
26
26
  gem.add_runtime_dependency(%q<erubis>, ["~> 2.7.0"])
27
27
  gem.add_runtime_dependency(%q<rocco>, ["~> 0.7"])
28
28
  gem.add_runtime_dependency(%q<thor>, ["~> 0.15.4"])
29
- gem.add_runtime_dependency(%q<compass>, ["~> 0.12.2"])
29
+ #gem.add_runtime_dependency(%q<compass>, ["~> 0.12.2"])
30
30
  gem.add_runtime_dependency(%q<session>, ["~> 3.1"])
31
- gem.add_runtime_dependency(%q<middleman>, ["3.0.12"])
31
+ gem.add_runtime_dependency(%q<middleman>, ["3.1.4"])
32
32
  gem.add_runtime_dependency("middleman-target")
33
33
  gem.add_runtime_dependency(%q<faraday>)
34
34
  gem.add_runtime_dependency("json")
35
+ gem.add_runtime_dependency("rack-rewrite")
36
+
35
37
 
36
38
  # gem.add_development_dependency(%q<bundler>, ["~> 1.0.14"])
37
39
  gem.add_development_dependency(%q<bundler>, ["~> 1.1"])
@@ -1,8 +1,8 @@
1
1
  Handlebars.registerHelper 'SectionUrl', (section)->
2
- "#sections/#{section.id}"
2
+ "/#sections/#{section.id}"
3
3
 
4
4
  Handlebars.registerHelper 'ProjectUrl', (project)->
5
- "#projects/#{project.id}"
5
+ "/#projects/#{project.id}"
6
6
 
7
7
  Handlebars.registerHelper 'ProjectImg', (version)->
8
8
  v = version ? version : "url"
@@ -6,6 +6,6 @@ class Pullentity.Collections.Projects extends Backbone.Collection
6
6
 
7
7
  url : ()->
8
8
  if @id
9
- "#{Pullentity.Domain}.pullentity.com/api/v1/site/projects/#{@id}"
9
+ "#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/projects/#{@id}"
10
10
  else
11
- "#{Pullentity.Domain}.pullentity.com/api/v1/site/projects"
11
+ "#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/projects"
@@ -7,7 +7,7 @@ class Pullentity.Collections.Sections extends Backbone.Collection
7
7
 
8
8
  url : ()->
9
9
  if @id
10
- "#{Pullentity.Domain}.pullentity.com/api/v1/site/sections/#{@id}"
10
+ "#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/sections/#{@id}"
11
11
  else
12
- "#{Pullentity.Domain}.pullentity.com/api/v1/site/sections"
12
+ "#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/sections"
13
13
 
@@ -1,7 +1,7 @@
1
1
  class Pullentity.Models.Site extends Backbone.Model
2
2
  url : ()->
3
3
  if @id
4
- "#{Pullentity.Domain}.pullentity.com/api/v1/site"
4
+ "#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site"
5
5
  else
6
- "#{Pullentity.Domain}.pullentity.com/api/v1/sites"
6
+ "#{Pullentity.Domain}.#{Pullentity.host}/api/v1/sites"
7
7
 
@@ -11,6 +11,7 @@ if _.isUndefined window.pullentity_domain
11
11
 
12
12
  window.Pullentity =
13
13
  Domain: window.pullentity_domain
14
+ host: "pullentity.com" # "pullentity.dev:3000" #
14
15
  Models: {}
15
16
  Collections: {}
16
17
  Routers: {}
@@ -23,6 +23,8 @@ class Pullentity.Views.Commons.Main extends Backbone.View
23
23
 
24
24
  @render()
25
25
 
26
+ @setupLinks()
27
+
26
28
  # quizas cargar router acá
27
29
 
28
30
  setTitle: ()=>
@@ -45,7 +47,7 @@ class Pullentity.Views.Commons.Main extends Backbone.View
45
47
  #console.log("get section #{id}")
46
48
  @find_in_section(id)
47
49
 
48
- Backbone.history.start() #(pushState: true)
50
+ Backbone.history.start(pushState: true)
49
51
 
50
52
  render: ()=>
51
53
  #console.info("should render layout")
@@ -128,4 +130,26 @@ class Pullentity.Views.Commons.Main extends Backbone.View
128
130
  #console.error "error while creating Handlebars script out of template for [", $(@current_theme_obj), e
129
131
  throw e
130
132
 
133
+ setupLinks: ()=>
134
+ # Globally capture clicks. If they are internal and not in the pass
135
+ # through list, route them through Backbone's navigate method.
136
+ $(document).on "click", "a[href^='/']", (event) =>
137
+
138
+ href = $(event.currentTarget).attr('href')
139
+
140
+ # chain 'or's for other black list routes
141
+ passThrough = href.indexOf('sign_out') >= 0
142
+
143
+ # Allow shift+click for new tabs, etc.
144
+ if !passThrough && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey
145
+ event.preventDefault()
146
+
147
+ # Remove leading slashes and hash bangs (backward compatablility)
148
+ url = href.replace(/^\//,'').replace('\#\/','')
149
+
150
+ # Instruct Backbone to trigger routing events
151
+ @app_router.navigate url, { trigger: true }
152
+
153
+ return false
154
+
131
155
  layout = new Pullentity.Views.Commons.Main
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pullentity-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-01 00:00:00.000000000 Z
12
+ date: 2013-08-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: coffee-script
@@ -124,13 +124,13 @@ dependencies:
124
124
  - !ruby/object:Gem::Version
125
125
  version: 0.15.4
126
126
  - !ruby/object:Gem::Dependency
127
- name: compass
127
+ name: session
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ~>
132
132
  - !ruby/object:Gem::Version
133
- version: 0.12.2
133
+ version: '3.1'
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,41 +138,41 @@ dependencies:
138
138
  requirements:
139
139
  - - ~>
140
140
  - !ruby/object:Gem::Version
141
- version: 0.12.2
141
+ version: '3.1'
142
142
  - !ruby/object:Gem::Dependency
143
- name: session
143
+ name: middleman
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
147
- - - ~>
147
+ - - '='
148
148
  - !ruby/object:Gem::Version
149
- version: '3.1'
149
+ version: 3.1.4
150
150
  type: :runtime
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  none: false
154
154
  requirements:
155
- - - ~>
155
+ - - '='
156
156
  - !ruby/object:Gem::Version
157
- version: '3.1'
157
+ version: 3.1.4
158
158
  - !ruby/object:Gem::Dependency
159
- name: middleman
159
+ name: middleman-target
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
- - - '='
163
+ - - ! '>='
164
164
  - !ruby/object:Gem::Version
165
- version: 3.0.12
165
+ version: '0'
166
166
  type: :runtime
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  none: false
170
170
  requirements:
171
- - - '='
171
+ - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
- version: 3.0.12
173
+ version: '0'
174
174
  - !ruby/object:Gem::Dependency
175
- name: middleman-target
175
+ name: faraday
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements:
@@ -188,7 +188,7 @@ dependencies:
188
188
  - !ruby/object:Gem::Version
189
189
  version: '0'
190
190
  - !ruby/object:Gem::Dependency
191
- name: faraday
191
+ name: json
192
192
  requirement: !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
@@ -204,7 +204,7 @@ dependencies:
204
204
  - !ruby/object:Gem::Version
205
205
  version: '0'
206
206
  - !ruby/object:Gem::Dependency
207
- name: json
207
+ name: rack-rewrite
208
208
  requirement: !ruby/object:Gem::Requirement
209
209
  none: false
210
210
  requirements:
@@ -430,12 +430,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
430
430
  - - ! '>='
431
431
  - !ruby/object:Gem::Version
432
432
  version: '0'
433
+ segments:
434
+ - 0
435
+ hash: 4005454624083693998
433
436
  required_rubygems_version: !ruby/object:Gem::Requirement
434
437
  none: false
435
438
  requirements:
436
439
  - - ! '>='
437
440
  - !ruby/object:Gem::Version
438
441
  version: '0'
442
+ segments:
443
+ - 0
444
+ hash: 4005454624083693998
439
445
  requirements: []
440
446
  rubyforge_project:
441
447
  rubygems_version: 1.8.25