phraseapp-in-context-editor-ruby 1.0.0rc1 → 1.0.0rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4be8b6a00f8f8a7b37bcd0b0e9c8d8b644e82437
4
- data.tar.gz: 6da6d82bf29e6963f254274672391bfe3633ecfc
3
+ metadata.gz: 4325c7a4e441bfc4288a29d972e0b886c5236877
4
+ data.tar.gz: 2fa708ebd1c04662d0e1480c88c88cc59fc5e740
5
5
  SHA512:
6
- metadata.gz: d2ddb6b58918200f87fadcfa2bd971d046c706b88e8c82e9e4fba9be4ec88c71fb6a6dba3a1ea074f73807c9dda9cefb865acffc29823944002867edc9ccbe05
7
- data.tar.gz: 9d937971b6fdaf1462fd8ee4ba8f890f0587bd81f71f75441d3ff39bc09b52b5520e7c99e27c0975d1f4a188f2cb41f33a587c5d91cbeb3c3916a1428b11c8f1
6
+ metadata.gz: 0dca937d1e0cc66ae285a904590e261888fc5fcff992138aa570a4bb124404ffc1452e4ba425000f0b7abea237f0be5dfa08d6d7300f7d0d74ac596b9c4b3852
7
+ data.tar.gz: 1c088c52227f68e31e6bcafe4a57058d75f98e46e43152f8a54076e7592e1bd8458f7eb8c079734e4e795c7ad02a8355b09db33a0d1d6e855ff477c0c9c5aaad
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # PhraseApp In-Context-Editor #
1
+ # PhraseApp In-Context-Editor for Ruby #
2
2
 
3
- *This Ruby gem is for use with Ruby/Rails applications only. Check out the [documentation](http://docs.phraseapp.com/guides/in-context-editor/) to learn how to set up the In-Context-Editor with other technologies.*
3
+ *This Ruby gem is for use with Ruby (Rails, Sinatra) applications only. Check out the [documentation](http://docs.phraseapp.com/guides/in-context-editor/) to learn how to set up the In-Context-Editor with other technologies.*
4
4
 
5
5
  [![Build Status](https://travis-ci.org/phrase/phraseapp-in-context-editor-ruby.svg)](https://travis-ci.org/phrase/phraseapp-in-context-editor-ruby)
6
6
 
@@ -32,11 +32,11 @@ and install it:
32
32
 
33
33
  Next, create the initializer file by executing the Rails generator:
34
34
 
35
- $ bundle exec rails generate phraseapp-in-context-editor-ruby:install --access-token=<YOUR_TOKEN> --project-id=<YOUR_PROJECT_ID>
35
+ $ bundle exec rails generate phraseapp_in_context_editor:install --access-token=<YOUR_TOKEN> --project-id=<YOUR_PROJECT_ID>
36
36
 
37
37
  ##### --access-token
38
38
 
39
- You can create and manage access tokens in your [profile settings](https://phraseapp.com/settings/profile/oauth_access_tokens) or via the [Authorizations API](http://docs.phraseapp.com/api/v2/authorizations).
39
+ You can create and manage access tokens in your [profile settings](https://phraseapp.com/settings/oauth_access_tokens) or via the [Authorizations API](http://docs.phraseapp.com/api/v2/authorizations).
40
40
 
41
41
  ##### --project-id
42
42
 
@@ -3,7 +3,7 @@ Welcome to PhraseApp!
3
3
 
4
4
  PhraseApp is the translation management solution for web and mobile applications. Collaborate with your team, find professional translators and stay on top of the process.
5
5
 
6
- Our In-Context Editor offers just that. It provides translators with useful contextual information which improves overall translation quality.
6
+ How awesome would it be if translators could simply browse your website and edit text along the way? Our In-Context Editor offers just that. It provides translators with useful contextual information which improves overall translation quality.
7
7
 
8
8
  Login: https://phraseapp.com/account/login
9
9
  Documentation: http://docs.phraseapp.com/guides/in-context-editor/
@@ -58,6 +58,15 @@ module PhraseApp
58
58
  @@suffix = suffix
59
59
  end
60
60
 
61
+ def api_host
62
+ @@api_host = nil if !defined? @@api_host or @@api_host.nil?
63
+ @@api_host
64
+ end
65
+
66
+ def api_host=(api_host)
67
+ @@api_host = api_host
68
+ end
69
+
61
70
  def js_host
62
71
  @@js_host ||= 'phraseapp.com'
63
72
  end
@@ -101,7 +110,7 @@ module PhraseApp
101
110
 
102
111
  protected
103
112
  def authorized_api_client
104
- auth_handler = PhraseApp::Auth::AuthHandler.new(token: PhraseApp::InContextEditor.access_token)
113
+ auth_handler = PhraseApp::Auth::AuthHandler.new(token: PhraseApp::InContextEditor.access_token, host: api_host)
105
114
  PhraseApp::Auth.register_auth_handler(auth_handler)
106
115
  PhraseApp::Client
107
116
  end
@@ -1,6 +1,6 @@
1
1
  module PhraseApp
2
2
  module InContextEditor
3
- VERSION = "1.0.0rc1"
3
+ VERSION = "1.0.0rc2"
4
4
  end
5
5
  end
6
6
 
@@ -4,10 +4,15 @@ module PhraseApp
4
4
  def phraseapp_in_context_editor_js
5
5
  return "" unless PhraseApp::InContextEditor.enabled?
6
6
 
7
+ js_config = ["projectId: '#{PhraseApp::InContextEditor.project_id}'"]
8
+ if PhraseApp::InContextEditor.api_host.present?
9
+ js_config << "apiBaseUrl: '#{PhraseApp::InContextEditor.api_host}/api/v2'"
10
+ end
11
+
7
12
  js = <<-eos
8
13
  <script>
9
14
  window.PHRASEAPP_CONFIG = {
10
- projectId: '#{PhraseApp::InContextEditor.project_id}'
15
+ #{js_config.join(', ')}
11
16
  };
12
17
  (function() {
13
18
  var phraseapp = document.createElement('script'); phraseapp.type = 'text/javascript'; phraseapp.async = true;
@@ -66,6 +66,10 @@ module PhraseApp
66
66
  config.js_host
67
67
  end
68
68
 
69
+ def api_host
70
+ config.api_host
71
+ end
72
+
69
73
  def api_client
70
74
  config.api_client
71
75
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.require_paths = ["lib"]
23
23
  s.add_dependency('json', '~> 1.8')
24
24
  s.add_dependency('i18n', '~> 0.7')
25
- s.add_dependency('phraseapp-ruby', '~> 1.0')
25
+ s.add_dependency('phraseapp-ruby', '~> 1.0.17')
26
26
  s.add_development_dependency('rspec', '~> 3.2')
27
27
  s.add_development_dependency('webmock', '~> 1.21')
28
28
  s.add_development_dependency('vcr', '~> 2.9')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phraseapp-in-context-editor-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0rc1
4
+ version: 1.0.0rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynport GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-16 00:00:00.000000000 Z
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: 1.0.17
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
54
+ version: 1.0.17
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: 1.3.6
177
177
  requirements: []
178
178
  rubyforge_project: phraseapp-in-context-editor-ruby
179
- rubygems_version: 2.4.5
179
+ rubygems_version: 2.2.1
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: Translation management solution for web and mobile applications