ruby_native 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/config/signals.yml +5 -0
- data/lib/ruby_native/engine.rb +0 -6
- data/lib/ruby_native/helper.rb +4 -0
- data/lib/ruby_native/version.rb +1 -1
- data/lib/ruby_native.rb +22 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 833ee6403127ec6df4f7fcb42cca062b48d7e719902059f982451278eade0209
|
|
4
|
+
data.tar.gz: 234cb926954f458d8f98d3b5e2dc8dd8e831bf0dd5d724ebd14e9686e7ce0219
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e244d2e734b9b59d143b1d97c66301aa8733632d4d65897508f6aace6a1668a90ef2771396220bd3dfd7c22420ebbc0a599d55d01e2e5dbadfd064072e13f4a2
|
|
7
|
+
data.tar.gz: e90eacfe5a6c86de36fdb0ae9ad9b80dcbb4ae9be5dc4b9f03ec5977c8f2673abc0aebd8a10dbd25e8f1bdd3e5cedfa2d22d91f7b869c58dd990626d1168b973
|
data/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[Ruby Native](https://rubynative.com) turns a Rails app into iOS and Android apps. This gem is the Rails-side integration: view helpers, a YAML config file, endpoints auto-mounted at `/native`, and a CLI for previewing and deploying builds. Full docs, including the complete helper reference and config schema, live at [rubynative.com/docs](https://rubynative.com/docs).
|
|
4
4
|
|
|
5
|
+
It is built for teams with a Rails product whose customers want an app. You keep one codebase and one roadmap: Ruby Native renders the HTML you already write as native tab bars, navigation, forms, and push notifications, builds the apps in the cloud with no Xcode or Android Studio, and submits them to the App Store and Google Play. A coding agent can drive every step through the bundled MCP server, stopping only for the few clicks Apple keeps for a person. Apps built with it run on 150,000+ devices. Pricing is one plan per app, $199 a month or $1,990 a year, at [rubynative.com/pricing](https://rubynative.com/pricing); the phone preview costs nothing and needs no account.
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```ruby
|
data/config/signals.yml
CHANGED
data/lib/ruby_native/engine.rb
CHANGED
|
@@ -32,12 +32,6 @@ module RubyNative
|
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
initializer "ruby_native.config" do
|
|
36
|
-
config.after_initialize do
|
|
37
|
-
RubyNative.load_config
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
35
|
initializer "ruby_native.oauth_middleware", before: :build_middleware_stack do |app|
|
|
42
36
|
app.middleware.insert_before ActionDispatch::Cookies, RubyNative::OAuthMiddleware
|
|
43
37
|
end
|
data/lib/ruby_native/helper.rb
CHANGED
|
@@ -38,6 +38,10 @@ module RubyNative
|
|
|
38
38
|
OpenSSL::HMAC.hexdigest("SHA256", Rails.application.secret_key_base, parts.join(":"))[0, 16]
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
def native_locale_tag(locale = I18n.locale)
|
|
42
|
+
tag.div(data: { native_locale: locale }, hidden: true)
|
|
43
|
+
end
|
|
44
|
+
|
|
41
45
|
def native_back_button_tag(text = nil, **options)
|
|
42
46
|
options[:class] = [options[:class], "native-back-button"].compact.join(" ")
|
|
43
47
|
default_content = tag.svg(
|
data/lib/ruby_native/version.rb
CHANGED
data/lib/ruby_native.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require "erb"
|
|
2
|
+
require "monitor"
|
|
2
3
|
require "ruby_native/version"
|
|
3
4
|
require "ruby_native/helper"
|
|
4
5
|
require "ruby_native/native_version"
|
|
@@ -16,7 +17,6 @@ require "ruby_native/screenshots/sign_in_helper"
|
|
|
16
17
|
require "ruby_native/engine"
|
|
17
18
|
|
|
18
19
|
module RubyNative
|
|
19
|
-
mattr_accessor :config
|
|
20
20
|
mattr_accessor :subscription_callbacks, default: []
|
|
21
21
|
|
|
22
22
|
# Screenshot configuration. Set via `RubyNative.configure` in an initializer.
|
|
@@ -41,6 +41,26 @@ module RubyNative
|
|
|
41
41
|
subscription_callbacks.each { |cb| cb.call(event) }
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
CONFIG_LOCK = Monitor.new
|
|
45
|
+
private_constant :CONFIG_LOCK
|
|
46
|
+
|
|
47
|
+
# Loaded on first read, not at boot: rendering the YAML's ERB runs asset
|
|
48
|
+
# helpers, and under `assets:precompile` those run before the bundles are
|
|
49
|
+
# built, leaving Propshaft's manifest without them.
|
|
50
|
+
def self.config
|
|
51
|
+
return @config if defined?(@config)
|
|
52
|
+
|
|
53
|
+
CONFIG_LOCK.synchronize do
|
|
54
|
+
load_config unless defined?(@config)
|
|
55
|
+
@config = nil unless defined?(@config) # missing or empty file
|
|
56
|
+
@config
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def self.config=(value)
|
|
61
|
+
@config = value
|
|
62
|
+
end
|
|
63
|
+
|
|
44
64
|
def self.load_config
|
|
45
65
|
path = Rails.root.join("config", "ruby_native.yml")
|
|
46
66
|
return unless path.exist?
|
|
@@ -48,7 +68,7 @@ module RubyNative
|
|
|
48
68
|
parsed = YAML.load(render_config(path), filename: path.to_s, aliases: true)
|
|
49
69
|
|
|
50
70
|
# An empty file, comments only, or ERB rendering to nothing parses to nil;
|
|
51
|
-
# treat it like a missing file instead of
|
|
71
|
+
# treat it like a missing file instead of raising.
|
|
52
72
|
unless parsed.is_a?(Hash)
|
|
53
73
|
Rails.logger.warn("[RubyNative] #{path} is empty or not a YAML mapping; ignoring it.")
|
|
54
74
|
return
|