All code is available in example app - https://github.com/maxivak/webpacker-rails-example-app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Select objects in array whose key includes a value | |
* | |
* @param {Array} arr Array to test | |
* @param {String} key Key to inspect | |
* @param {String} value Value key needs to include | |
* @return {String} Filtered array | |
* | |
*/ | |
module.exports = function (arr, key, value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Select objects in array whose key matches a value | |
* | |
* @param {Array} arr Array to test | |
* @param {String} key Key to inspect | |
* @param {String} value Value key needs to match | |
* @return {String} Filtered array | |
* | |
*/ | |
module.exports = function (arr, key, value) { |
$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$PROJECT_DIR/$INFOPLIST_FILE") | |
build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$PROJECT_DIR/$INFOPLIST_FILE") | |
/usr/libexec/PlistBuddy -c "Set PreferenceSpecifiers:0:DefaultValue $version ($build)" "$SRCROOT/FunWithSettings/Settings.bundle/Root.plist" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>StringsTable</key> | |
<string>Root</string> | |
<key>PreferenceSpecifiers</key> | |
<array> | |
<dict> | |
<key>Type</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>StringsTable</key> | |
<string>Child</string> | |
<key>PreferenceSpecifiers</key> | |
<array> | |
<dict> | |
<key>Type</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>StringsTable</key> | |
<string>Root</string> | |
<key>PreferenceSpecifiers</key> | |
<array> | |
<dict> | |
<key>Type</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
protocol ProductListViewControllerDelegate: class { | |
func productListViewController(_ vc: ProductListViewController, didSelectProduct product: Product) | |
} | |
class ProductListViewController: UIViewController { | |
weak var delegate: ProductListViewControllerDelegate? | |
} | |
protocol ProductDetailViewControllerDelegate: class { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
private var purchaseCoordinator: PurchaseCoordinator | |
func application(_ application: UIApplication, | |
didFinishLaunchingWithOptions launchOptions: | |
[UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
let window = UIWindow(frame: UIScreen.main.bounds) |