tr8n_client_sdk 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Tr8n Client SDK for Ruby on Rails
2
+
3
+ This Client SDK provides all tools and extensions necessary for translating any Rails application using the Tr8n service.
4
+
5
+ You can use http://sandbox.tr8nhub.com or download and install the service locally by following these instructions:
6
+
7
+ ```sh
8
+ $ git clone https://github.com/tr8n/tr8n.git
9
+ $ cd tr8n/test/dummy
10
+ $ bundle install
11
+ $ rake db:migrate
12
+ $ rake tr8n:init
13
+ $ rails s
14
+ ```
15
+
16
+ Open your browser and point to:
17
+
18
+ http://localhost:3000
19
+
20
+ This is your Tr8n Service Instance.
21
+
22
+ Now you can install and run the Client SDK sample.
23
+
24
+
25
+ # Runing the Client SDK Sample
26
+
27
+ To run the gem as a stand-alone application follow these:
28
+
29
+ Make sure you edit the config/tr8n/config.yml file and provide the correct application host, key and secret for your application.
30
+
31
+ ```sh
32
+ $ git clone https://github.com/tr8n/tr8n_rails_clientsdk.git
33
+ $ cd tr8n_rails_clientsdk/test/dummy
34
+ $ bundle install
35
+ $ rake db:migrate
36
+ $ rails s -p 3001
37
+ ```
38
+
39
+ Alternatively, you can see the same sample application as a stand alone app:
40
+
41
+ https://github.com/tr8n/tr8n_rails_clientsdk_sample
42
+
43
+
44
+ # Integration Instructions
45
+
46
+ Here are a few points on how to integrate Tr8n into your app:
47
+
48
+ Add the following gems to your Gemfile:
49
+
50
+ ```ruby
51
+ gem 'tr8n_core'
52
+ gem 'tr8n_client_sdk'
53
+ ```
54
+
55
+ Install the gems:
56
+
57
+ ```sh
58
+ $ bundle
59
+ ```
60
+
61
+ Generate config file:
62
+
63
+ ```sh
64
+ $ rails g tr8n_client_sdk
65
+ ```
66
+
67
+ Open the config file and provide your application credentials:
68
+
69
+ ```
70
+ application:
71
+ host: http://localhost:3000
72
+ key: YOUR_APP_KEY
73
+ secret: YOUR_APP_SECRET
74
+ ```
75
+
76
+ In the HEAD section of your layout, add:
77
+
78
+ ```ruby
79
+ <%= tr8n_scripts_tag %>
80
+ ```
81
+
82
+ You are done, tr8n is now running in your app.
83
+
84
+ To read more about what you can do with it, visit the wiki site:
85
+
86
+ http://wiki.tr8nhub.com
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2013 Michael Berkovich, tr8nhub.com
2
+ # Copyright (c) 2013 Michael Berkovich, tr8nhub.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2013 Michael Berkovich, tr8nhub.com
2
+ # Copyright (c) 2013 Michael Berkovich, tr8nhub.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -78,7 +78,6 @@ module Tr8nClientSdk
78
78
  @tr8n_started_at = Time.now
79
79
 
80
80
  Tr8n.config.init_application
81
- tr8n_application.update_cache_version
82
81
 
83
82
  translator = nil
84
83
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2013 Michael Berkovich, tr8nhub.com
2
+ # Copyright (c) 2013 Michael Berkovich, tr8nhub.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2013 Michael Berkovich, tr8nhub.com
2
+ # Copyright (c) 2013 Michael Berkovich, tr8nhub.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2013 Michael Berkovich, tr8nhub.com
2
+ # Copyright (c) 2013 Michael Berkovich, tr8nhub.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -23,5 +23,5 @@
23
23
 
24
24
 
25
25
  module Tr8nClientSdk
26
- VERSION = "1.0.0"
26
+ VERSION = "1.1.0"
27
27
  end
@@ -26,4 +26,9 @@ class HomeController < ApplicationController
26
26
  def index
27
27
  end
28
28
 
29
+ def upgrade_cache
30
+ Tr8n.cache.upgrade_version
31
+ trfn("Cache has been upgraded")
32
+ redirect_to(request.env['HTTP_REFERER'])
33
+ end
29
34
  end
@@ -44,6 +44,9 @@
44
44
 
45
45
  <li class="divider"></li>
46
46
  <li><%= link_to_function tr("Shortcuts"), "Tr8n.UI.Lightbox.show('/tr8n/help/lb_shortcuts', {width:400})" %></li>
47
+ <% if Tr8n.cache.enabled? and not Tr8n.cache.read_only? %>
48
+ <li><%= link_to(tr("Upgrade Cache ({num})", :num => Tr8n.cache.version), :controller => :home, :action => :upgrade_cache) %></li>
49
+ <% end %>
47
50
 
48
51
  <li class="divider"></li>
49
52
  <li><%=link_to_function(tr("Logout"), "Tr8n.UI.Lightbox.show('/login/out?mode=lightbox', {width:400});")%></li>
@@ -13,6 +13,8 @@ defaults:
13
13
  enabled: false
14
14
  adapter: memcache
15
15
  host: localhost:11211
16
+ # adapter: redis
17
+ # host: localhost:6379
16
18
  path: /cache
17
19
  version: 1
18
20
  timeout: 3600