smartling_rails 0.0.4 → 0.0.5

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: f95995d680484c17f93b888e63d18e4fdf0b20e4
4
- data.tar.gz: d33416b260cc4f3ef94a18b0cad473871b8bdfb9
3
+ metadata.gz: 1505c53a3f7f9e487ef576420ae7761dfde132b8
4
+ data.tar.gz: 3f0432a00bf9102a6919686a23e57961e077b7d8
5
5
  SHA512:
6
- metadata.gz: 79b18b1174106c1749614dbe54ad4adfec26dcef9794e5a986b1d313880d3f3200aa9827d3e4dacde33c4e8d3bf0e623913104a4d347f8069eb8908d07db3c76
7
- data.tar.gz: 5df2447fc1623299fcf87e8b654165e8e9d58afeb0cd64c17661251ef04e4ce13cdcd7c51f2660e294a2e526e382d3f58a51e409e57a16ba9050c9e505d62db4
6
+ metadata.gz: 5ecf45e5d87f00363ab67eefe2458bbafab93deaee42de3c0b175d2c8f9d9eaf843d84c673eee7c044c4457a5ddfebc0e72b6e0b2b1e38f4eac02d80dd45b36a
7
+ data.tar.gz: 039b4ac5cb575c2bc9a26ad870ed9134884eb1faf1d716c6f4a9a9f3319e7186395b7e08fe50a2b180bb283e4a87fb38c04ccd9468433cef2f2e15fd756dfe9d
data/README.md CHANGED
@@ -63,6 +63,42 @@ Fixing Issues:
63
63
 
64
64
  ```
65
65
 
66
+ ## usage: rake commands
67
+
68
+ This gem comes fully equiped with rake commands to help leverage the gem from the command line.
69
+
70
+ Once you've installed the gem using `gem install smartling_rails` or by adding `gem 'smartling_rails', '~> 0.0.4'` to your **Gemfile** you can update your **Rakefile** with the following lines:
71
+
72
+ ```
73
+ spec = Gem::Specification.find_by_name 'smartling_rails'
74
+ load "#{spec.gem_dir}/lib/tasks/smartling_rails.rake"
75
+ ```
76
+
77
+ This will allow you to perform the following from the command line:
78
+
79
+ ```
80
+ $> bundle exec rake -T
81
+ ...
82
+ rake smartling:get # download the translations ...
83
+ rake smartling:put # upload the en-us.yml file...
84
+ rake smartling:status # check statuses
85
+ ...
86
+
87
+ $> bundle exec rake smartling:put
88
+ $> bundle exec rake smartling:status
89
+ $> bundle exec rake smartling:status
90
+ Attempting to get translation statuses:
91
+
92
+ You are working with this remote file on smartling: /files/smartling-rails-[APPNAME]-[BRANCHNAME]-en-us.yml
93
+ Smartling Ruby client 0.5.1
94
+
95
+ Checking status for ["French fr-FR", "German de-DE", "Dutch nl-NL"]
96
+ fr-FR completed: false (158 / 161)
97
+ de-DE completed: true (161 / 161)
98
+ ...
99
+ ```
100
+
101
+
66
102
  ## structure
67
103
  The smartling_rails gem consists of 3 components
68
104
 
@@ -1,6 +1,6 @@
1
1
  module SmartlingRails
2
2
  class Config
3
- attr_accessor :api_key, :project_id, :locales
3
+ attr_accessor :api_key, :project_id, :rails_app_name, :locales
4
4
 
5
5
  def initialize
6
6
  #TODO source from yaml file
@@ -23,6 +23,7 @@ module SmartlingRails
23
23
  key_val = line.split("=")
24
24
  @api_key = key_val[1].strip if key_val[0] == 'SMARTLING_API_KEY'
25
25
  @project_id = key_val[1].strip if key_val[0] == 'SMARTLING_PROJECT_ID'
26
+ @rails_app_name = key_val[1].strip if key_val[0] == 'SMARTLING_APP_NAME'
26
27
  end
27
28
  end unless !File.exist?('.env')
28
29
  end
@@ -3,7 +3,6 @@ module SmartlingRails
3
3
  attr_accessor :my_smartling
4
4
 
5
5
  def initialize()
6
- puts SmartlingRails.configuration
7
6
  @my_smartling = Smartling::File.new(:apiKey => SmartlingRails.api_key, :projectId => SmartlingRails.project_id)
8
7
  #@my_smartling = Smartling::File.sandbox(:apiKey => @@api_key, :projectId => @@project_id)
9
8
  #puts @my_smartling.list
@@ -49,7 +48,7 @@ module SmartlingRails
49
48
  end
50
49
 
51
50
  def upload_file_path()
52
- "/files/smartling-rails-[APPNAME]-[#{get_current_branch}]-en-us.yml"
51
+ "/files/[#{SmartlingRails.configuration.rails_app_name}]-[#{get_current_branch}]-en-us.yml"
53
52
  end
54
53
 
55
54
  def get_files
@@ -1,3 +1,3 @@
1
1
  module SmartlingRails
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartling_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - The CareerBuilder.com Consumer Development teams