Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require "wreq"

# Build a client
client = Wreq::Client.new(emulation: Wreq::Emulation.new(
profile: Wreq::Profile::Chrome147,
profile: Wreq::Profile::Chrome148,
platform: Wreq::Platform::MacOS,
http2: true,
headers: true
Expand Down
12 changes: 12 additions & 0 deletions lib/wreq_ruby/emulate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class Profile
Chrome145 = nil
Chrome146 = nil
Chrome147 = nil
Chrome148 = nil

Edge101 = nil
Edge122 = nil
Edge127 = nil
Expand All @@ -74,6 +76,8 @@ class Profile
Edge145 = nil
Edge146 = nil
Edge147 = nil
Edge148 = nil

Firefox109 = nil
Firefox117 = nil
Firefox128 = nil
Expand All @@ -92,6 +96,9 @@ class Profile
Firefox147 = nil
Firefox148 = nil
Firefox149 = nil
Firefox150 = nil
Firefox151 = nil

SafariIos17_2 = nil
SafariIos17_4_1 = nil
SafariIos16_5 = nil
Expand All @@ -115,10 +122,13 @@ class Profile
Safari26 = nil
Safari26_1 = nil
Safari26_2 = nil
Safari26_3 = nil
Safari26_4 = nil
SafariIos26 = nil
SafariIos26_2 = nil
SafariIPad26 = nil
SafariIpad26_2 = nil

OkHttp3_9 = nil
OkHttp3_11 = nil
OkHttp3_13 = nil
Expand All @@ -127,6 +137,7 @@ class Profile
OkHttp4_10 = nil
OkHttp4_12 = nil
OkHttp5 = nil

Opera116 = nil
Opera117 = nil
Opera118 = nil
Expand All @@ -142,6 +153,7 @@ class Profile
Opera128 = nil
Opera129 = nil
Opera130 = nil
Opera131 = nils
end

unless method_defined?(:to_s)
Expand Down
15 changes: 15 additions & 0 deletions src/emulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ define_ruby_enum!(
Chrome145,
Chrome146,
Chrome147,
Chrome148,

Edge101,
Edge122,
Expand All @@ -67,6 +68,7 @@ define_ruby_enum!(
Edge145,
Edge146,
Edge147,
Edge148,

Firefox109,
Firefox117,
Expand All @@ -86,6 +88,8 @@ define_ruby_enum!(
Firefox147,
Firefox148,
Firefox149,
Firefox150,
Firefox151,

SafariIos17_2,
SafariIos17_4_1,
Expand All @@ -110,6 +114,8 @@ define_ruby_enum!(
Safari26,
Safari26_1,
Safari26_2,
Safari26_3,
Safari26_4,
SafariIos26,
SafariIos26_2,
SafariIPad26,
Expand Down Expand Up @@ -139,6 +145,7 @@ define_ruby_enum!(
Opera128,
Opera129,
Opera130,
Opera131,
);

define_ruby_enum!(
Expand Down Expand Up @@ -253,6 +260,8 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> {
profile.const_set("Chrome145", Profile::Chrome145)?;
profile.const_set("Chrome146", Profile::Chrome146)?;
profile.const_set("Chrome147", Profile::Chrome147)?;
profile.const_set("Chrome148", Profile::Chrome148)?;

profile.const_set("Edge101", Profile::Edge101)?;
profile.const_set("Edge122", Profile::Edge122)?;
profile.const_set("Edge127", Profile::Edge127)?;
Expand All @@ -271,6 +280,7 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> {
profile.const_set("Edge145", Profile::Edge145)?;
profile.const_set("Edge146", Profile::Edge146)?;
profile.const_set("Edge147", Profile::Edge147)?;
profile.const_set("Edge148", Profile::Edge148)?;

profile.const_set("Firefox109", Profile::Firefox109)?;
profile.const_set("Firefox117", Profile::Firefox117)?;
Expand All @@ -290,6 +300,8 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> {
profile.const_set("Firefox147", Profile::Firefox147)?;
profile.const_set("Firefox148", Profile::Firefox148)?;
profile.const_set("Firefox149", Profile::Firefox149)?;
profile.const_set("Firefox150", Profile::Firefox150)?;
profile.const_set("Firefox151", Profile::Firefox151)?;

profile.const_set("SafariIos17_2", Profile::SafariIos17_2)?;
profile.const_set("SafariIos17_4_1", Profile::SafariIos17_4_1)?;
Expand All @@ -314,6 +326,8 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> {
profile.const_set("Safari26", Profile::Safari26)?;
profile.const_set("Safari26_1", Profile::Safari26_1)?;
profile.const_set("Safari26_2", Profile::Safari26_2)?;
profile.const_set("Safari26_3", Profile::Safari26_3)?;
profile.const_set("Safari26_4", Profile::Safari26_4)?;
profile.const_set("SafariIos26", Profile::SafariIos26)?;
profile.const_set("SafariIos26_2", Profile::SafariIos26_2)?;
profile.const_set("SafariIPad26", Profile::SafariIPad26)?;
Expand Down Expand Up @@ -343,6 +357,7 @@ pub fn include(ruby: &Ruby, gem_module: &RModule) -> Result<(), Error> {
profile.const_set("Opera128", Profile::Opera128)?;
profile.const_set("Opera129", Profile::Opera129)?;
profile.const_set("Opera130", Profile::Opera130)?;
profile.const_set("Opera131", Profile::Opera131)?;

// Platform enum binding
let platform = gem_module.define_class("Platform", ruby.class_object())?;
Expand Down