Comments (5)
@travisjeffery I'm assuming you can enable request stubbing by passing:
Analytics.init({ stub: true, ... })
Correct? Any chance you could add a bit of documentation on Analytics#initialize?
It's a little odd that the setup process isn't documented in the README. I can submit a PR if you folks need some help getting that into shape.
from analytics-ruby.
@olivierlacan :stub
is documented at the bottom of our dedicated docs page, which is linked on the readme. go here: https://segment.io/docs/libraries/ruby/ and scroll to the bottom. i'll add a section title for that bit, thanks for bringing this up. all the options are documented there.
stub's available in v2, which is namespaced and not a singleton. so you would do:
Analytics = Segment::Analytics.new(stub: true)
from analytics-ruby.
Yeah, that makes some sense. I definitely want to have more logging in the library everywhere which can be enabled, so big +1 on logging requests there, though I'm not sure if I'm sold on the DI route yet.
FWIW: what we do currently is set up a "development" project and then use a separate key for prod vs dev setups. We then look at requests going into the segment.io debugger when figuring out what is being sent.
from analytics-ruby.
ok you'll be able to stub requests when that's pushed, i'm not sold on di in ruby either. http://david.heinemeierhansson.com/2012/dependency-injection-is-not-a-virtue.html
from analytics-ruby.
Thanks! I'm not going to argue about DI or not even though it would add more extensibility.
This solves testing/dev mode issue so thank you very much!
from analytics-ruby.
Related Issues (20)
- at_exit question HOT 1
- Error in documentation HOT 2
- Issues with sending several events at the same moment HOT 1
- anonymous_id HOT 2
- Adding message_id to track call using js2.0 style messageId fails to process HOT 2
- Using `Analytics.flush` to ensure event delivery order? HOT 4
- Empty string user id's silently fail to send events HOT 1
- window._cio.page is not a function HOT 2
- override listid for mailchimp HOT 5
- Modify timestamp to have 3 fractional digits
- Convert project to Github Actions
- Missing some tracked events in debugger HOT 2
- ::Segment is too generic a namespace HOT 1
- API returns a 200 with wrong auth key HOT 6
- Convert to Github Actions HOT 1
- wrong argument type nil (expected String) HOT 1
- [Idea] Avoid silent failures or make more noise when maximum JSON message size reached
- Nil error message in Segment::Analytics::Response object HOT 2
- Future of this gem. HOT 1
- Prep for release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics-ruby.